// Use this for initialization // Update is called once per frame void Start() { CreateMap(); pcon = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); if (gi.firstStage) { pcon.InitializeData(); ActionButtonController abc = GameObject.FindGameObjectWithTag("ActionButtonController").GetComponent <ActionButtonController>(); abc.SetIcons(); gi.firstStage = false; } pcon.abc.ResetTimers(); pcon.abc.RefreshPotsAmountText(); Spawner spawner = GameObject.FindGameObjectWithTag("Assets").GetComponent <Spawner>(); spawner.enabled = true; pcon.gameObject.transform.position = gi.startPos; int x = Mathf.RoundToInt(gi.startPos.x); int y = Mathf.RoundToInt(gi.startPos.y); Vector2Int pos = new Vector2Int(x, y); pcon.RefreshPosAsInt(pos); pcon.UpdateMapPos(x, y); }
// Use this for initialization void Start() { if (intance == null) { intance = this; } else { Destroy(gameObject); } fingerId = -1; }
public void SetActionButtonController() { PlayerController pcon = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); this.abc = pcon.abc; }