// Start is called before the first frame update
 void Start()
 {
     cookieCount     = 0;
     sceneMover      = (SceneMovement)FindObjectOfType(typeof(SceneMovement));
     manager         = (CreatureManagerScript)FindObjectOfType(typeof(CreatureManagerScript));
     isCookieCharged = false;
     cookieReadyObj.SetActive(false);
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     manager = (CreatureManagerScript)FindObjectOfType(typeof(CreatureManagerScript));
     //startSize = 1;
     for (int i = 1; i < startSize; i++)
     {
         size++;
         transform.localScale *= scalingFactor;
     }
 }
    // Use this for initialization
    void Start()
    {
        meshFieldGeneratorScript = (MeshFieldGeneratorScript)GameObject.Find("MainMeshField").GetComponent("MeshFieldGeneratorScript");
        mainCameraComponent      = (Camera)GameObject.Find("Main Camera").GetComponent("Camera");
        bloomScript = (Bloom)GameObject.Find("Main Camera").GetComponent("Bloom");
        GameObject[] meshLightsObjectsArray = GameObject.FindGameObjectsWithTag("MeshLight");

        for (int i = 0; i < meshLightsObjectsArray.Length; i++)
        {
            meshLightsList.Add((Light)(meshLightsObjectsArray[i]).GetComponent("Light"));
        }

        creatureManagerScript = (CreatureManagerScript)GameObject.Find("CreatureManager").GetComponent("CreatureManagerScript");
        mainCameraGameObject  = GameObject.Find("Main Camera");
    }
    public void AquireCreatureParts(GameObject[] partsArray)
    {
        playerScript = (PlayerScript)GameObject.FindGameObjectWithTag("Player").GetComponent("PlayerScript");
        creatureManagerScript = (CreatureManagerScript)GameObject.Find("CreatureManager").GetComponent("CreatureManagerScript");

        List<GameObject> creaturePartsList = new List<GameObject>();
        List<Vector3> creaturePartsOriginalPositionList = new List<Vector3>();
        for(int i = 0; i < partsArray.Length; i++ )
        {
            partsArray[i].transform.parent = transform;
            ((CreaturePartsGeneralScript)partsArray[i].GetComponent("CreaturePartsGeneralScript")).isPartOfCreature = true;
            creaturePartsList.Add(partsArray[i]);
            creaturePartsOriginalPositionList.Add(partsArray[i].transform.position);

            partsRandomStartPositionsList.Add( creatureManagerScript.GenerateRandomPointOnSemiSpehere());  // set random target start positions for each part
        }
        creaturePartsArray = creaturePartsList.ToArray();
        creaturePartsOriginalPositionArray = creaturePartsOriginalPositionList.ToArray();

        creatureState = CreatureStates.MovingPartsToRandomStartPositions;
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        meshFieldGeneratorScript = (MeshFieldGeneratorScript)GameObject.Find("MainMeshField").GetComponent("MeshFieldGeneratorScript");

        GameObject[] tempCameraObjectArray =  GameObject.FindGameObjectsWithTag("MainCamera");
        for(int i = 0; i < tempCameraObjectArray.Length; i++)
            mainCameraComponentList.Add( (Camera)tempCameraObjectArray[i].GetComponent("Camera") );

        //mainCameraComponent = (Camera)GameObject.Find("Main Camera").GetComponent("Camera");

        for(int i = 0; i < tempCameraObjectArray.Length; i++)
            bloomScriptList.Add( (Bloom)tempCameraObjectArray[i].GetComponent("Bloom") );

        GameObject[] meshLightsObjectsArray =  GameObject.FindGameObjectsWithTag("MeshLight");

        for(int i =0; i < meshLightsObjectsArray.Length; i++)
        {
            meshLightsList.Add( (Light)(meshLightsObjectsArray[i]).GetComponent("Light") );
        }

        creatureManagerScript = (CreatureManagerScript)GameObject.Find("CreatureManager").GetComponent("CreatureManagerScript");
        mainCameraGameObject =  GameObject.FindWithTag("MainCamera"); //GameObject.Find("Main Camera");

        if(isOVR)
            ovrCameraController = (OVRCameraController)GameObject.Find("OVRCameraController").GetComponent("OVRCameraController");

        editor = (GeneralEditorScript)GameObject.Find("Editor_Importer").GetComponent("GeneralEditorScript");

        Screen.showCursor = false;
        Screen.lockCursor = true;
    }