コード例 #1
0
    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);
        }
    }
コード例 #2
0
    private void Start()
    {
        vm = FindObjectOfType <VariablesManager>();
        gm = FindObjectOfType <GManager>();
        rs = GetComponent <RotateSelf>();
        rs.RotateSprite(spriteTF, dir, false);
        currentWait = startSteps;

        gm.turnStep.AddListener(TurnStep);
    }
コード例 #3
0
    private void OnMouseUpAsButton()
    {
        if (rotationable)
        {
            rs = GetComponent <RotateSelf>();
            if (rs == null)
            {
                rs = gameObject.AddComponent <RotateSelf>();
            }

            dir = rs.RotateSprite(spriteTF, dir);
        }
    }