Fist Sub
based on aimbot multi seane
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class EnvArgsChanger : MonoBehaviour
|
||||
{
|
||||
public GameObject DataTransfer;
|
||||
|
||||
[Header("EnemyNum")]
|
||||
public Text EnemyNumText;
|
||||
public InputField EnemyNumInput;
|
||||
|
||||
[Header("TimeLimit")]
|
||||
public Text TimeLimText;
|
||||
public InputField TimelimInput;
|
||||
|
||||
[Header("Decision Period")]
|
||||
public Slider DecisionPeriodSlide;
|
||||
public Text DecisionPeriodDataText;
|
||||
public Toggle TakeActionsBetweenDecisionsToggle;
|
||||
|
||||
[Header("Lock Mouse")]
|
||||
public Toggle LockMouseToggle;
|
||||
|
||||
[Header("Default Camera")]
|
||||
public Toggle FPToggle;
|
||||
public Text FPText;
|
||||
public Toggle TPToggle;
|
||||
public Text TPText;
|
||||
|
||||
private StartSeneData startSeneData;
|
||||
private void Start()
|
||||
{
|
||||
startSeneData = DataTransfer.GetComponent<StartSeneData>();
|
||||
}
|
||||
|
||||
|
||||
public void onEnemynumValueChanged()
|
||||
{
|
||||
// enemy total num value control
|
||||
if (EnemyNumInput.GetComponent<InputField>().text == "" || EnemyNumInput.GetComponent<InputField>().text.Contains("-"))
|
||||
{
|
||||
EnemyNumText.color = Color.gray;
|
||||
}
|
||||
else
|
||||
{
|
||||
EnemyNumText.color = Color.yellow;
|
||||
startSeneData.EnemyNum = Math.Abs(int.Parse(EnemyNumInput.GetComponent<InputField>().text));
|
||||
}
|
||||
}
|
||||
|
||||
public void onTimeValueChanged()
|
||||
{
|
||||
// time limit value control
|
||||
if (TimelimInput.GetComponent<InputField>().text == "" || TimelimInput.GetComponent<InputField>().text.Contains("-"))
|
||||
{
|
||||
TimeLimText.color = Color.gray;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeLimText.color = Color.yellow;
|
||||
startSeneData.Timelim = Math.Abs(int.Parse(TimelimInput.GetComponent<InputField>().text));
|
||||
}
|
||||
}
|
||||
|
||||
public void onDPSlideValueChanged()
|
||||
{
|
||||
// DecisionPeriod(DP) value Control
|
||||
startSeneData.DecisionPeriod = (int)(DecisionPeriodSlide.GetComponent<Slider>().value);
|
||||
DecisionPeriodDataText.text = startSeneData.DecisionPeriod.ToString();
|
||||
}
|
||||
public void onABDToggleChanged()
|
||||
{
|
||||
// Actions Between Decisions(ABD) Toggle Control
|
||||
startSeneData.ActionsBetweenDecisions = TakeActionsBetweenDecisionsToggle.isOn;
|
||||
}
|
||||
public void onLockMouseToggleChanged()
|
||||
{
|
||||
// lock mouse or not
|
||||
startSeneData.lockMouse = LockMouseToggle.isOn;
|
||||
}
|
||||
public void onTPCamToggleChanged()
|
||||
{
|
||||
startSeneData.defaultTPCamera = true;
|
||||
|
||||
FPToggle.interactable = true;
|
||||
FPToggle.SetIsOnWithoutNotify(false);
|
||||
FPText.color = Color.gray;
|
||||
|
||||
TPToggle.SetIsOnWithoutNotify(true);
|
||||
TPToggle.interactable = false;
|
||||
TPText.color = Color.green;
|
||||
}
|
||||
public void onFPCameToggleChanged()
|
||||
{
|
||||
startSeneData.defaultTPCamera = false;
|
||||
|
||||
TPToggle.interactable = true;
|
||||
TPToggle.SetIsOnWithoutNotify(false);
|
||||
TPText.color = Color.gray;
|
||||
|
||||
FPToggle.SetIsOnWithoutNotify(true);
|
||||
FPToggle.interactable = false;
|
||||
FPText.color = Color.green;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccfe892ab0f980343b6df0fafaec38e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class LoadDirChanger : MonoBehaviour
|
||||
{
|
||||
public InputField LoadDirDateTextBox;
|
||||
public InputField LoadDirTimeTextBox;
|
||||
public Toggle Toggle;
|
||||
public GameObject DataTransfer;
|
||||
|
||||
|
||||
public void OnDirToggleChanged()
|
||||
{
|
||||
// if loadDirToggle is on then turn off the input text boxs.
|
||||
LoadDirDateTextBox.interactable = Toggle.isOn;
|
||||
LoadDirTimeTextBox.interactable = Toggle.isOn;
|
||||
// if loadDirToggle is off set loaddirs as 0.
|
||||
if (!Toggle.isOn)
|
||||
{
|
||||
DataTransfer.GetComponent<StartSeneData>().LoadDirDate = "0";
|
||||
DataTransfer.GetComponent<StartSeneData>().LoadDirTime = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDateValueChanged()
|
||||
{
|
||||
string input = LoadDirDateTextBox.GetComponent<InputField>().text;
|
||||
DataTransfer.GetComponent<StartSeneData>().LoadDirDate = input;
|
||||
}
|
||||
public void OnTimeValueChanged()
|
||||
{
|
||||
string input = LoadDirTimeTextBox.GetComponent<InputField>().text;
|
||||
DataTransfer.GetComponent<StartSeneData>().LoadDirTime = input;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 664e98da80fb4d842b0c3aff09fd4dc9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,120 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RewardsChange : MonoBehaviour
|
||||
{
|
||||
public GameObject DataTransfer;
|
||||
|
||||
public GameObject nonRInputOBJ;
|
||||
public GameObject shootRInputOBJ;
|
||||
public GameObject shootWithoutReadyRInputOBJ;
|
||||
public GameObject hitRInputOBJ;
|
||||
public GameObject killRInputOBJ;
|
||||
public GameObject winRInputOBJ;
|
||||
public GameObject loseRInputOBJ;
|
||||
|
||||
|
||||
public Text nonRInputText;
|
||||
public Text shootRInputText;
|
||||
public Text shootWithoutReadyRInputText;
|
||||
public Text hitRInputText;
|
||||
public Text killRInputText;
|
||||
public Text winRInputText;
|
||||
public Text loseRInputText;
|
||||
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
// Update is called once per frame
|
||||
|
||||
public void nonRValueChanged()
|
||||
{
|
||||
if (nonRInputOBJ.GetComponent<InputField>().text == "" || nonRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
nonRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().nonReward = DataTransfer.GetComponent<StartSeneData>().nonRewardDefault;
|
||||
}
|
||||
else
|
||||
{
|
||||
nonRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().nonReward = float.Parse(nonRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void shootRValueChanged()
|
||||
{
|
||||
if (shootRInputOBJ.GetComponent<InputField>().text == "" || shootRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
shootRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().shootReward = DataTransfer.GetComponent<StartSeneData>().shootRewardDefault;
|
||||
}
|
||||
else {
|
||||
shootRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().shootReward = float.Parse(shootRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void shootWOReadyRValueChanged()
|
||||
{
|
||||
if(shootWithoutReadyRInputOBJ.GetComponent<InputField>().text == "" || shootWithoutReadyRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
shootWithoutReadyRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().shootWithoutReadyReward = DataTransfer.GetComponent<StartSeneData>().shootWithoutReadyRewardDefault;
|
||||
}
|
||||
else{
|
||||
shootWithoutReadyRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().shootWithoutReadyReward = float.Parse(shootWithoutReadyRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void hitRValueChanged()
|
||||
{
|
||||
if(hitRInputOBJ.GetComponent<InputField>().text == "" || hitRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
hitRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().hitReward = DataTransfer.GetComponent<StartSeneData>().hitRewardDefault;
|
||||
}
|
||||
else{
|
||||
hitRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().hitReward = float.Parse(hitRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void winRValueChanged()
|
||||
{
|
||||
if(winRInputOBJ.GetComponent<InputField>().text == "" || winRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
winRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().winReward = DataTransfer.GetComponent<StartSeneData>().winRewardDefault;
|
||||
}
|
||||
else{
|
||||
winRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().winReward = float.Parse(winRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void loseRValueChanged()
|
||||
{
|
||||
if(loseRInputOBJ.GetComponent<InputField>().text == "" || loseRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
loseRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().loseReward = DataTransfer.GetComponent<StartSeneData>().loseRewardDefault;
|
||||
}
|
||||
else{
|
||||
loseRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().loseReward = float.Parse(loseRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
public void killRValueChanged()
|
||||
{
|
||||
if(killRInputOBJ.GetComponent<InputField>().text == "" || killRInputOBJ.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
killRInputText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().killReward = DataTransfer.GetComponent<StartSeneData>().killRewardDefault;
|
||||
}
|
||||
else{
|
||||
killRInputText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().killReward = float.Parse(killRInputOBJ.GetComponent<InputField>().text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44fd351436d221849991bd84d37d8109
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class SceneChange : MonoBehaviour
|
||||
{
|
||||
public GameObject DataTransfer;
|
||||
public Text errorText;
|
||||
// Start is called before the first frame update
|
||||
bool checkLoadDirFormat()
|
||||
{
|
||||
string thisLoadDirDate = DataTransfer.GetComponent<StartSeneData>().LoadDirDate;
|
||||
string thisLoadDirTime = DataTransfer.GetComponent<StartSeneData>().LoadDirTime;
|
||||
int LoadDirDateLength = thisLoadDirDate.Length;
|
||||
int LoadDirTimeLength = thisLoadDirTime.Length;
|
||||
if ((LoadDirDateLength == 8 && LoadDirTimeLength == 6) || (thisLoadDirDate == "0" && thisLoadDirTime == "0"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onStartClick()
|
||||
{
|
||||
if (checkLoadDirFormat())
|
||||
{
|
||||
errorText.text = "Loading next Scene...";
|
||||
errorText.color = Color.green;
|
||||
SceneManager.LoadScene("InGame");
|
||||
}
|
||||
else
|
||||
{
|
||||
errorText.text = "Dir Format error";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73ae3df5f5faba1428ab2529c043b7ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class StartSeneData : MonoBehaviour
|
||||
{
|
||||
[Header("Default Rewards")]
|
||||
public float nonRewardDefault = -0.05f;
|
||||
public float shootRewardDefault = -0.06f;
|
||||
public float shootWithoutReadyRewardDefault = -0.06f;
|
||||
public float hitRewardDefault = 5.0f;
|
||||
public float killRewardDefault = 10.0f;
|
||||
public float winRewardDefault = 20.0f;
|
||||
public float loseRewardDefault = -0.05f;
|
||||
public bool lockMouse = false;
|
||||
public bool defaultTPCamera = true;
|
||||
|
||||
// LoadDir
|
||||
[System.NonSerialized]public string LoadDirDate = "0";
|
||||
[System.NonSerialized]public string LoadDirTime = "0";
|
||||
|
||||
// Rewards
|
||||
[System.NonSerialized] public float nonReward;
|
||||
[System.NonSerialized] public float shootReward;
|
||||
[System.NonSerialized] public float shootWithoutReadyReward;
|
||||
[System.NonSerialized] public float hitReward;
|
||||
[System.NonSerialized] public float killReward;
|
||||
[System.NonSerialized] public float winReward;
|
||||
[System.NonSerialized] public float loseReward;
|
||||
|
||||
// DecisionPeriod
|
||||
[System.NonSerialized] public int DecisionPeriod = 1;
|
||||
[System.NonSerialized] public bool ActionsBetweenDecisions = true;
|
||||
|
||||
// EnemyNum
|
||||
[System.NonSerialized] public int EnemyNum = 3;
|
||||
|
||||
// TimeLimit
|
||||
[System.NonSerialized] public int Timelim = 15;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
nonReward = nonRewardDefault;
|
||||
shootReward = shootRewardDefault;
|
||||
shootWithoutReadyReward = shootWithoutReadyRewardDefault;
|
||||
hitReward = hitRewardDefault;
|
||||
killReward = killRewardDefault;
|
||||
winReward = winRewardDefault;
|
||||
loseReward = loseRewardDefault;
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Awake()
|
||||
{
|
||||
DontDestroyOnLoad(transform.gameObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52ba7faaa6129cf418f26c5933d4ea0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user