private void Start() { if (vm == null) { vm = FindObjectOfType <VariablesManager>(); } rClick = GetComponent <RotateSelf>(); if (rClick == null) { rClick = gameObject.AddComponent <RotateSelf>(); } if (spriteTF == null) { spriteTF = GetComponentInChildren <SpriteRenderer>().transform; } dir = rClick.RotateSprite(spriteTF, dir, false); if (startRandom) { dir = vm.GetRandomDir(); rClick.RotateSprite(spriteTF, dir, false); } }
private void Start() { vm = FindObjectOfType <VariablesManager>(); gm = FindObjectOfType <GManager>(); rs = GetComponent <RotateSelf>(); rs.RotateSprite(spriteTF, dir, false); currentWait = startSteps; gm.turnStep.AddListener(TurnStep); }
private void OnMouseUpAsButton() { if (rotationable) { rs = GetComponent <RotateSelf>(); if (rs == null) { rs = gameObject.AddComponent <RotateSelf>(); } dir = rs.RotateSprite(spriteTF, dir); } }