コード例 #1
0
    private void Start()
    {
        // timer

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

        //finished = GameObject.Find("Portal").GetComponent<GameOver>();
        door = GameObject.Find("Door").GetComponent <CesarOpen>();

        shieldActivated = false;
        index           = 0;
        icon            = GameObject.Find("shieldToken");

        shieldText.enabled = false;
        //keyText.enabled = false;
        shieldText.text = "";


        //st = GameObject.FindWithTag("ShieldTimer");
        stimer        = timer.GetComponent <ShieldTimer>();
        timer.enabled = false;
    }
コード例 #2
0
ファイル: Become.cs プロジェクト: evoucou/Obstacle_Island
    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;
//        }
    }
コード例 #3
0
ファイル: CesarOpen.cs プロジェクト: evoucou/Obstacle_Island
    void Start()
    {
        //player = GameObject.FindWithTag("ActivePlayer");
        actionPickup = player.GetComponent <Pickupper>();

        defaultRotationAngle = transform.localEulerAngles.y;
    }
コード例 #4
0
ファイル: EnemyBehaviour.cs プロジェクト: Justinel2/ISLAND
    void Start()
    {
        // Get the NavMeshAgent component
        agent      = this.GetComponent <NavMeshAgent>();
        controller = GetComponentInParent <NavMeshController>();

        // Calls the "Pickupper" script on the player (if you follow the Pickupper script's instructions, the player should have the pickupper script on him)
        pickUpFunction = player.GetComponent <Pickupper>();

        // Enemy starts his round
        GoToNextPoint();
    }
コード例 #5
0
ファイル: Eat.cs プロジェクト: Joe-Power/DivIsland
    public void EatFood()
    {
        myFood = GetComponentInParent <Pickupper>();

        if (myFood.IsHoldingObject())
        {
            foodLoc = myFood.grabPoint;
            foreach (Transform child in foodLoc)
            {
                Eatable eatable = child.GetComponent <Eatable>();
                if (child.gameObject != null && eatable != null)
                {
                    Vector3 foodSize = child.gameObject.transform.localScale;
                    StartCoroutine(EatTheShit(child, foodSize, duration));
                }
            }
        }
    }
コード例 #6
0
ファイル: Eat.cs プロジェクト: evoucou/Obstacle_Island
    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;
    }
コード例 #7
0
 // Start is called before the first frame update
 void Start()
 {
     pickupper = GetComponent <Pickupper>();
 }
コード例 #8
0
ファイル: UseController.cs プロジェクト: Justinel2/ISLAND
 // Start is called before the first frame update
 void Start()
 {
     PickUp = GetComponent <Pickupper>();
 }
コード例 #9
0
    //player actions
    private void PlayerActions()
    {
        float horizontal = Input.GetAxis("Horizontal");
        float vertical   = Input.GetAxis("Vertical");

        RigidBodyController controller = GetComponentInParent <RigidBodyController>();

        controller.Locomote(new Vector3(horizontal, 0, vertical));
        controller.Rotate();


        if (Input.GetKeyDown(KeyCode.Space))
        {
            controller.Jump();
        }

        if (Input.GetMouseButtonDown(0))
        {
            //become other player on left click
            CreateRay();
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            if (CamMode == 1)
            {
                CamMode = 0;
            }
            else
            {
                CamMode++;
            }
            StartCoroutine(CamChange());
        }

        if (Input.GetKeyDown(KeyCode.U))
        {
            if (actionPickup && actionPickup.IsHoldingObject())
            {
                Usable usable = actionPickup.HeldObject().GetComponent <Usable>();
                if (usable)
                {
                    usable.Use();
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.I))
        {
            //checks for the actionpickup script and if it is holding an object
            if (actionPickup && actionPickup.IsHoldingObject())
            {
                //get the spawner script in the children component of pickupper script
                actionSpawn = actionPickup.GetComponentInChildren <Spawner>();
                //call spawn function
                actionSpawn.Spawn();
            }
        }
        if (Input.GetKeyDown(KeyCode.P))
        {
            //call pickup function
            actionPickup = GetComponentInParent <Pickupper>();
            actionPickup.PickUp();
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            //call eat function
            actionEat = GetComponentInParent <Eat>();
            actionEat.EatFood();
        }
        if (Input.GetKeyDown(KeyCode.T))
        {
            if (actionPickup && actionThrow && actionPickup.IsHoldingObject())
            {
                actionThrow.ThrowObject();
            }
        }
        //... more actions
    }
コード例 #10
0
ファイル: Interactor.cs プロジェクト: zeroZshadow/Ritual
	// Use this for initialization
	void Start () {
		InputHandler = ConfigurableInput.Instance;
		pickupper = GetComponent<Pickupper>();
	}
コード例 #11
0
ファイル: Throw.cs プロジェクト: Joe-Power/DivIsland
 // Start is called before the first frame update
 void Start()
 {
     pickupper  = GetComponent <Pickupper>();
     throwSound = GetComponent <AudioSource>();
 }