Exemple #1
0
    void Start()
    {
        rB = this.GetComponent <Rigidbody>();
        if (rB == null)
        {
            Debug.LogError("404: rB in PlayerCtrl");
        }
        anim = this.GetComponent <Animator>();
        if (anim == null)
        {
            Debug.LogError("404: anim in PlayerCtrl");
        }
        caps = this.GetComponent <CapsuleCollider>();
        if (caps == null)
        {
            Debug.LogError("404: caps in PlayerCtrl");
        }
        joystic = GameObject.Find("JoysticBG").GetComponent <VirtualJoystic>();
        if (rB == null)
        {
            Debug.LogError("404: joystic in PlayerCtrl");
        }
        bRun = GameObject.Find("ButRun").GetComponent <But_Action>();
        if (bRun == null)
        {
            Debug.LogError("404: bRun in PlayerCtrl");
        }

        walkSpd = 2f;
    }
Exemple #2
0
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        if (player == null)
        {
            Debug.LogError("404: Player in ColliderBeh");
        }

        ctrl = GameObject.Find("JoysticBG").GetComponent <VirtualJoystic>();
        if (ctrl == null)
        {
            Debug.LogError("404: ctrl in ColliderBeh");
        }

        anim = player.GetComponent <Animator>();
        if (anim == null)
        {
            Debug.LogError("404: anim in ColliderBeh");
        }

        pScript = player.GetComponent <PlayerAnimKitchen>();

        bAction = GameObject.Find("ButAction").GetComponent <But_Action>();
        if (bAction == null)
        {
            Debug.LogError("404: ButtonAction in CollidersBeh");
        }

        canDo = true;
    }