Beispiel #1
0
    void Start()
    {
        actionPickup = GetComponentInParent <Pickupper>();
        actionEat    = GetComponentInParent <Eat>();
        actionShield = GetComponentInParent <ShieldActivator>();

        st     = GameObject.FindWithTag("ShieldTimer");
        stimer = st.GetComponent <ShieldTimer>();


        fpsCam           = GetComponent <Camera>();
        firstCamPosition = GetComponent <Transform>().localPosition;
        thirdCamPosition = firstCamPosition + new Vector3(0, 5, -5);
        actionThrow      = GetComponent <Throw>();

        // set the current object to ActivePlayer
        gameObject.transform.parent.tag = "ActivePlayer";

        shield = GameObject.FindWithTag("Shield");

        //shieldOff = shield.GetComponent<ShieldActivator>();
//    if(shield != null) {
//    render = shield.GetComponent<MeshRenderer>();
//    collider = shield.GetComponent<Collider>();
//    shieldActivated = false;
//        }
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
//    shield = GameObject.FindWithTag("Shield");
//    render = shield.GetComponent<MeshRenderer>();
//    collider = shield.GetComponent<Collider>();

        actionShield = GetComponentInParent <ShieldActivator>();

        inRange      = false;
        buttonDown   = false;
        isHoldingKey = false;
        isHolding    = false;
    }
Beispiel #3
0
    void Start()
    {
        isChanging = false;
        myFood     = GetComponentInParent <Pickupper>();

//    shield = GameObject.FindWithTag("Shield");
//    render = shield.GetComponent<MeshRenderer>();
//    collider = shield.GetComponent<Collider>();

        actionShield = GetComponentInParent <ShieldActivator>();

        //playerSize = player.transform.localScale;
        small = false;
        //player = GameObject.FindWithTag("ActivePlayer");
        playerSize = this.transform.localScale;

        initialPos       = initialObj.transform.position;
        initialPosPlayer = initialPlayer.transform.position;

        //initialPos = shroom.transform.position;
    }