//make sure that all the canvase are in the correct state and transparency setting private void Awake() { Manager = GameObject.FindGameObjectWithTag("manager"); if (Manager != null) { movingManager = Manager.GetComponent <MovingManager>(); swiping = Manager.GetComponent <SwipeEventManager>(); } swiping.enabled = false; if (Play != null) { PlayCG = Play.GetComponent <CanvasGroup>(); if (PlayCG.alpha != 1) { PlayCG.alpha = 1; } Play.SetActive(true); PlayCG.interactable = true; PlayCG.blocksRaycasts = true; } if (Resume != null) { ResumeCG = Resume.GetComponent <CanvasGroup>(); if (ResumeCG.alpha != 0) { ResumeCG.alpha = 0; } Resume.SetActive(true); ResumeCG.interactable = false; ResumeCG.blocksRaycasts = false; } if (YouLose != null) { YouLoseCG = YouLose.GetComponent <CanvasGroup>(); if (YouLoseCG.alpha != 0) { YouLoseCG.alpha = 0; } YouLose.SetActive(false); } if (YouWin != null) { YouWinCG = YouWin.GetComponent <CanvasGroup>(); if (YouWinCG.alpha != 0) { YouWinCG.alpha = 0; } YouWin.SetActive(false); } }
private void Awake() { if (instance != null) { Debug.LogError("More than a one MovingManager in scene!"); return; } instance = this; }
// Start is called before the first frame update void Start() { rend = GetComponent <Renderer>(); startColor = rend.material.color; movingManager = MovingManager.instance; grid = GameObject.Find("GameManager").GetComponent <Grid>(); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void Start() { creationManager = GameObject.FindObjectOfType <CreationManager>(); selectionManager = GameObject.FindObjectOfType <SelectionManager>(); movingManager = GameObject.FindObjectOfType <MovingManager>(); if (EasySave.Load <bool>("isMapReset")) { isSaved = false; EasySave.Delete <bool>("isMapReset"); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } boardScript = GetComponent <BoardManager>(); uiScript = GetComponent <UIManager>(); movingScript = GetComponent <MovingManager>(); InitGame(); InitCurrentScore(); }
//Find the player gameobject and its child //This would allow me to implement a start menu where I could choose a different caracter for each player, // --> and not having a preset one like now private void Awake() { Manager = GameObject.FindGameObjectWithTag("manager"); if (Manager != null) { movingManager = Manager.GetComponent <MovingManager>(); } PlayerOne = GameObject.FindGameObjectWithTag("Player"); PlayerTwo = GameObject.FindGameObjectWithTag("cpu"); if (PlayerOne != null) { for (int i = 0; i < PlayerOne.transform.childCount; i++) { if (PlayerOne.transform.GetChild(i).gameObject.activeSelf == true) { FigureOne = PlayerOne.transform.GetChild(i).gameObject; } } } if (PlayerTwo != null) { for (int i = 0; i < PlayerTwo.transform.childCount; i++) { if (PlayerTwo.transform.GetChild(i).gameObject.activeSelf == true) { FigureTwo = PlayerTwo.transform.GetChild(i).gameObject; } } } if (FigureOne != null) { FigureOne.transform.DOLocalMoveY(Gitter, animationTime).SetEase(Ease.InOutQuad).SetLoops(-1, LoopType.Yoyo); } if (FigureTwo != null) { FigureTwo.transform.DOLocalMoveY(Gitter, animationTime).SetEase(Ease.InOutQuad).SetLoops(-1, LoopType.Yoyo); } }
// Use this for initialization void Start() { move = GetComponent <MovingManager>(); }