// Use this for initialization void Start() { parentSpawner = GetComponentInParent <Spawner>(); rb = GetComponent <Rigidbody2D>(); dancerAnimator = GetComponent <Animator>(); personalCollider = GetComponent <BoxCollider2D>(); playerMovement = FindObjectOfType <PlayerMovement>().GetComponent <PlayerMovement>(); sprite = GetComponentInChildren <SpriteRenderer>(); RandomizeColor(); timeBetweenLists = timeBetweenListsSet; gameController = FindObjectOfType <GameContoller>().GetComponent <GameContoller>(); currentDance = Mathf.FloorToInt(Random.Range(0, 4)); dancerAnimator.SetTrigger("Dance" + currentDance.ToString()); jetpackAnimator.SetBool("JetpackActive", true); if (gameController.jetpackDisable) { dancerAnimator.SetTrigger("Hover"); jetpackAnimator.SetBool("JetpackActive", false); } }
/*public float dI; * * * public List<int> listS = new List<int>(); * public List<int> listR = new List<int>(); * public List<int> listD = new List<int>(); * public List<int> listI = new List<int>(); * public List<int> listdR = new List<int>(); * public List<int> listdD = new List<int>(); * public List<int> listdI = new List<int>();*/ /*void SaveFile(List<int> list,string f) * { * StreamWriter sw = new StreamWriter(Application.dataPath + "/" + f + ".txt"); * string sp = " "; * * for(int i = 0; i < list.Count; i++) * { * sw.WriteLine(list[i]); * } * * sw.Close(); * }*/ // Start is called before the first frame update void Start() { for (int i = 0; i < 5; i++) { decree.Add(false); } GameObject Settings = GameObject.Find("Settings"); Settings SettingsScript = Settings.GetComponent <Settings>(); N = SettingsScript.N / 5f; I = SettingsScript.I / 5f; C = SettingsScript.C; g = SettingsScript.g; float a = SettingsScript.a; D = 0f; R = 0f; S = N - I - D - R; gamma = 1f / g; beta = gamma * C; alpha = a * gamma / 100; GameScript = GameControl.GetComponent <GameContoller>(); Rt = 0; Dt = 0; day = 0; StartCoroutine("SickPlusPlus"); }
// Use this for initialization void Start() { rigidbody2d = GetComponent <Rigidbody2D>(); playerAnimator = GetComponent <Animator>(); gameController = FindObjectOfType <GameContoller>().GetComponent <GameContoller>(); playerCollider = GetComponent <BoxCollider2D>(); }
public void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Obstacle") { GameContoller controller = FindObjectOfType <GameContoller>(); controller.RestartGame(); } }
void Awake() { beingDestroyed = false; rb = gameObject.GetComponent<Rigidbody>(); hits = Mathf.RoundToInt(gameObject.transform.localScale.x); rb.angularVelocity = Random.insideUnitSphere / (hits / maxtumble); SlowStart(); mainScore = GameObject.Find("GameController").GetComponent<GameContoller>(); }
//private int score; private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } gameScore = 0; }
void Awake() { if (INSTANCE == null) { INSTANCE = this; } else if (INSTANCE != this) { Debug.LogWarning("There's more than one GameContoller in the scene!"); Destroy(gameObject); } }
void Awake() { if (controller == null) { DontDestroyOnLoad(gameObject); controller = this; } else if (controller != this) { Destroy(gameObject); } }
void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent <GameContoller>(); } if (gameController == null) { Debug.Log("Cannot find 'GameController' script"); } }
// Use this for initialization void Start() { // Initialize the references parent = transform.parent; CardSprite = transform.GetChild(0).GetComponent <SpriteRenderer> (); CardSprite.sprite = FaceDownSprite; GC = GameObject.Find("GameController").GetComponent <GameContoller> (); // Set the Hand if (parent.name == "PlayerDeck") { Hand = GameObject.Find("PlayerHand"); } else { Hand = GameObject.Find("ComputerHand"); } }
// Start is called before the first frame update void Start() { GameScript = GameControl.GetComponent <GameContoller>(); }
// Start is called before the first frame update void Start() { GameScript = Game.GetComponent <GameContoller>(); //UIScript=UI.GetComponent<GameUI>(); }
// Use this for initialization void Start() { GC = GameObject.Find("GameController").GetComponent <GameContoller>(); }
private static void TestGame() { GameContoller game = new GameContoller(); game.RunGame(); }
// Use this for initialization void Start() { gamecontroller = FindObjectOfType <GameContoller>().GetComponent <GameContoller>(); }
// Use this for initialization void Start() { offset = transform.position - player.transform.position; gamecontroller = FindObjectOfType <GameContoller>().GetComponent <GameContoller>(); }
// Use this for initialization void Start() { gameController = FindObjectOfType <GameContoller> (); }
private void Awake() { instanse = this; }