Esempio n. 1
0
    public void level1Prefabs()
    {
        try{
            //			GameObject level2_stat_prfb = GameObject.Find ("land7_prefab");
            //			level2_stat_prfb.SetActive(false);
            //			GameObject[] allObjects = UnityEngine.Object.FindObjectsOfType<GameObject> ();
            //			foreach (GameObject go in allObjects)
            //			if (go.transform.name .Contains ("Start (1)") || go.transform.name .Contains ("Start")) {
            //				go.SetActive (true);
            PlayerPrefs.SetString("LEVEL", "LEVELI");
            //			}
            GameObject level2_stat_prfb = GameObject.Find("land3_prefab");
            currentTile = level2_stat_prfb;
            //			//			GameObject start1 = GameObject.Find ("Start (1)");
            //			currentTile = start1;
            if (temp_level1_prefb_arr.Length != 0)
            {
                GameObject      thePlayer     = GameObject.Find("H T_P F R_Prefab");
                playerBehaviour playerScript1 = thePlayer.GetComponent <playerBehaviour>();
                playerScript1.StartCoroutine(playerScript1.DeleteTiles(0f));
                LEVELONEPREFABS = temp_level1_prefb_arr;
                //				GameObject start1_1 = GameObject.Find ("Start (1)");
                //				currentTile = start1_1;
                playerScript1.isLevelCreated = false;

                LEVELONE_ENEMIESARRAY = temp_level2_enemy_arr;
            }
            else
            {
            }
            //	level2_stat_prfb.SetActive (false);
        }
        catch (System.Exception e) {}
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        navMesh         = GetComponent <NavMeshAgent>();
        playerBehaviour = destination.GetComponent <playerBehaviour>();

        hasKeyChaseSpeed = chaseSpeed * 1.4f;
    }
Esempio n. 3
0
    /*
     * FIGHTTAG is the key to know Hanuman to face Fights
     * (i.e Hanuman to face 1st Fight or 2nd one or 3rd One or 4th or 5th)
     * If FIGHTTAG is 0 , Hanuman will face 1st Fight at some distance
     */

    void Start()
    {
        GameObject      thePlayer     = GameObject.Find("H T_P F R_Prefab");
        playerBehaviour playerScript1 = thePlayer.GetComponent <playerBehaviour>();

        First_Enenmy_Position_Main____  = playerScript1.TILESCOUNT;
        Second_Enenmy_Position_Main____ = playerScript1.TILESCOUNT;
        Third_Enenmy_Position_Main____  = playerScript1.TILESCOUNT;
        Fourth_Enenmy_Position_Main____ = playerScript1.TILESCOUNT;
        Fifth_Enenmy_Position_Main____  = playerScript1.TILESCOUNT;

        //		PlayerPrefs.SetInt ("Diamond_Display__Int", 0);
        //		if (PlayerPrefs.GetString ("LEVEL").Equals ("LEVELII")) {
        //			LEVELONEPREFABS=new GameObject[LEVELIIPREFABS.Length];
        //			for(int i =0;i<LEVELONEPREFABS.Length;i++){
        //				LEVELONEPREFABS[i]=LEVELIIPREFABS[i];
        //			}
        //		}

        PlayerPrefs.SetInt("JetPackStatus", 0);
        instance = GameObject.FindObjectOfType <TileManager>();
        FIGHTTAG = PlayerPrefs.GetInt("FIGHTTAG");

        mygameobject = new GameObject();
    }
Esempio n. 4
0
 void Start()
 {
     PB      = GetComponent <playerBehaviour>();
     rb      = GetComponent <Rigidbody2D>();
     canMove = true;
     Physics2D.queriesStartInColliders = false;
 }
Esempio n. 5
0
    void Start()
    {
        BridgeWidth = bridge[0].gameObject.GetComponent <SpriteRenderer>().size.x;

        //StartCoroutine("barrelSpawn");

        _playerBehaviour = FindObjectOfType(typeof(playerBehaviour)) as playerBehaviour;
    }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     currentScene = SceneManager.GetActiveScene().name.ToString();
     Behaviour    = GameObject.FindGameObjectWithTag("Player").GetComponent <playerBehaviour>();
     inventory    = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
     PV           = Behaviour.getHP();
     TorchFuel    = Behaviour.getFuel();
     menuItems    = inventory.GetItems();
 }
Esempio n. 7
0
 void Start()
 {
     cm                    = GameObject.FindGameObjectWithTag("CM").GetComponent <CheckpointManager>();
     p1Behaviour           = GameObject.FindGameObjectWithTag("Player1").GetComponent <playerBehaviour>();
     p2Behaviour           = GameObject.FindGameObjectWithTag("Player2").GetComponent <playerBehaviour>();
     p1                    = GameObject.FindGameObjectWithTag("Player1");
     p2                    = GameObject.FindGameObjectWithTag("Player2");
     membrane              = GameObject.FindGameObjectWithTag("Membrane");
     membraneSupportSphere = GameObject.FindGameObjectWithTag("MembraneSupportSphere");
 }
Esempio n. 8
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        player1                 = GameObject.FindWithTag(player1Tag);
        p1RigidBody             = player1.GetComponent <Rigidbody>();
        p1RigidBody.constraints = RigidbodyConstraints.FreezeRotation;
        p1Behaviour             = player1.GetComponent <playerBehaviour>();


        player2                 = GameObject.FindWithTag(player2Tag);
        p2RigidBody             = player2.GetComponent <Rigidbody>();
        p2RigidBody.constraints = RigidbodyConstraints.FreezeRotation;
        p2Behaviour             = player2.GetComponent <playerBehaviour>();
    }
Esempio n. 10
0
    void Start()
    {
        membrane = GameObject.FindWithTag(membraneTag);
        membraneSupportSphere   = GameObject.FindWithTag(membraneSupportSphereTag);
        membraneSupportCollider = membraneSupportSphere.GetComponent <SphereCollider>();
        cloth    = membrane.GetComponent <Cloth>();
        material = membrane.GetComponent <Renderer>().material;

        player1     = GameObject.FindWithTag(player1Tag);
        player2     = GameObject.FindWithTag(player2Tag);
        p1Behaviour = player1.GetComponent <playerBehaviour>();
        p2Behaviour = player2.GetComponent <playerBehaviour>();
    }
Esempio n. 11
0
    // Update is called once per frame
    public void saveState()
    {
        PV        = Behaviour.getHP();
        TorchFuel = Behaviour.getFuel();
        menuItems = inventory.GetItems();

        currentScene = SceneManager.GetActiveScene().name.ToString();

        if (currentScene == "Level_2" || currentScene == "Level_3")
        {
            Behaviour = GameObject.FindGameObjectWithTag("Player").GetComponent <playerBehaviour>();
            inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>();
        }
    }
Esempio n. 12
0
    // Use this for initialization
    private void Awake()
    {
        currentScene = SceneManager.GetActiveScene().name.ToString();

        if (currentScene == "Level_2" || currentScene == "Level_3")
        {
            shoesTaken = true;
        }
        else
        {
            shoesTaken = false;
        }
        playerRigibody             = GetComponent <Rigidbody>();
        behaviour                  = GetComponent <playerBehaviour>();
        inventory                  = GetComponent <Inventory>();
        jumpSlider.value           = (((jumpForce - minAirJumpForce) / (maxJumpForce - minAirJumpForce)) * 100);
        playerRigibody.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY;
    }
Esempio n. 13
0
    // Start is called before the first frame update
    void Start()
    {
        player1                 = GameObject.FindWithTag(player1Tag);
        p1RigidBody             = player1.GetComponent <Rigidbody>();
        p1RigidBody.constraints = RigidbodyConstraints.FreezeRotation;
        p1Behaviour             = player1.GetComponent <playerBehaviour>();


        player2                 = GameObject.FindWithTag(player2Tag);
        p2RigidBody             = player2.GetComponent <Rigidbody>();
        p2RigidBody.constraints = RigidbodyConstraints.FreezeRotation;
        p2Behaviour             = player2.GetComponent <playerBehaviour>();

        // Makes sticking rays ignore players, cell membrane, and support structure
        LayerMask playerLayer  = 1 << 9;
        LayerMask cellLayer    = 1 << 10;
        LayerMask supportLayer = 1 << 11;

        layerMask = ~(playerLayer | cellLayer | supportLayer);

        source = GetComponent <AudioSource>();
    }
Esempio n. 14
0
 void Start()
 {
     cm = GameObject.FindGameObjectWithTag("CM").GetComponent <CheckpointManager>();
     player1behaviour = GameObject.FindGameObjectWithTag("Player1").GetComponent <playerBehaviour>();
     player2behaviour = GameObject.FindGameObjectWithTag("Player2").GetComponent <playerBehaviour>();
 }
Esempio n. 15
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <playerBehaviour>();
 }
Esempio n. 16
0
    private void Start()
    {
        MonitorPlayer = FindObjectOfType <playerBehaviour>();

        MonitorPlayer.OnGravityEffect += MonitorPlayer_OnGravityEffect; //Subscribe to main EventHandler
    }
    private void Awake()
    {
		m_Character = GetComponent<playerBehaviour>();
    }