Exemplo n.º 1
0
 public void Initialize(ManagerScript setManager, BlockPairScript setBlockPair, int width, int height)
 {
     manager     = setManager;
     towerWidth  = width;
     towerHeight = height;
     blockPair   = setBlockPair;
 }
Exemplo n.º 2
0
    void ButtonFunction()
    {
        ManagerScript managerScript = Manager.GetComponent <ManagerScript> ();

        switch (CellColor)
        {
        case "White":
            CellColor            = "Blue";
            managerScript.Water += 1;
            break;

        case "Blue":
            CellColor            = "Green";
            managerScript.Water -= 1;
            managerScript.Grass += 1;
            break;

        case "Green":
            CellColor            = "Red";
            managerScript.Grass -= 1;
            managerScript.Fire  += 1;
            break;

        case "Red":
            CellColor            = "Blue";
            managerScript.Fire  -= 1;
            managerScript.Water += 1;
            break;
        }
    }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (manager == null)
     {
         manager = FindObjectOfType <ManagerScript>();
     }
 }
Exemplo n.º 4
0
 private void Awake()
 {
     posibleMoveObject = transform.GetChild(0).gameObject;
     child             = GetComponentInChildren <Transform>();
     manager           = GameObject.FindGameObjectWithTag(ManagerScript.TAG).GetComponent <ManagerScript>();
     posibleToMove     = false;
 }
Exemplo n.º 5
0
 void Start()
 {
     note          = GetComponent <AudioSource> ();
     script        = player.GetComponent <PlayerStates> ();
     managerScript = manager.GetComponent <ManagerScript>();
     isCorrect     = false;
 }
Exemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     nva          = GetComponent <NavMeshAgent>();
     destination  = gameObject.transform.position;
     sphererange  = GetComponentInChildren <SphereCollisionDetection>();
     managerblock = FindObjectOfType <ManagerScript>();
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     //setShootingParameters(20,30,0f,3f,0f,4f);
     counter           = counterInitial;
     manager           = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ManagerScript>();
     manager.ItemsShot = 0;
 }
Exemplo n.º 8
0
    public void dock()
    {
        ManagerScript mScript = manager.GetComponent <ManagerScript>();

        mScript.In_To_Port(targetPort);
        current_port = targetPort;
    }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        random       = new System.Random(/*(int) Vector3.Angle(this.transform.position, Vector3.forward)*/);
        timeElapsed += random.Next(0, 4);

        manager = GameObject.FindGameObjectWithTag("Manager").GetComponentInChildren <ManagerScript>();
    }
Exemplo n.º 10
0
    void Start()
    {
        StartCoroutine(GetHighScores());
        initializeHighScoreScreen();

        manager = GameObject.Find("Manager").GetComponent <ManagerScript>();
    }
Exemplo n.º 11
0
 // Start is called before the first frame update
 void Start()
 {
     // pewSound = GetComponent<AudioSource>();
     managerScript           = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ManagerScript>();
     currentShootingCooldown = 0.0f;
     controller = GetComponent <CharacterController>();
 }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        Camera.main.transform.parent   = transform;
        Camera.main.transform.position = new Vector3(transform.position.x, transform.position.y, -10.0f);

        Quaternion test = Quaternion.identity;

        Rotations[0] = test * Quaternion.Euler(0, 0, 0);
        Rotations[1] = test * Quaternion.Euler(0, 0, 90);
        Rotations[2] = test * Quaternion.Euler(0, 0, 180);
        Rotations[3] = test * Quaternion.Euler(0, 0, 270);


        // meme
        hp_cur = hp_max;

        rb     = GetComponent <Rigidbody2D>();
        weapon = transform.GetChild(0).gameObject.GetComponent <WeaponScript>();

        canvas = GameObject.Find("Canvas");

        ScoreText = GameObject.FindGameObjectWithTag("Canvas").GetComponentInChildren <Text>();
        manager   = GameObject.FindGameObjectWithTag("Manager").GetComponentInChildren <ManagerScript>();
        setActiveWeapon();
    }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        rb2d = GetComponent <Rigidbody2D>();       //変数rb2dの中にRigidbody2dを格納しておく!
        rt   = GetComponent <RectTransform>();

        ms = GameObject.Find("Manager").GetComponent <ManagerScript>();
    }
Exemplo n.º 14
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     selfTr         = GetComponent <Transform>();
     ManagerObject  = GameObject.Find("Manager");
     _managerScript = ManagerObject.GetComponent <ManagerScript>();
     power          = _managerScript.getSpeed();
 }
Exemplo n.º 16
0
 private void Start()
 {
     manager            = GameObject.FindGameObjectWithTag("Manager").GetComponent <ManagerScript>();
     startPos.z         = target.transform.position.z - 23.9f;
     startPos.x         = target.transform.position.x - 25.3f;
     transform.position = new Vector3(startPos.x, transform.position.y, startPos.z);
 }
Exemplo n.º 17
0
    /// <summary>
    /// ///
    /// </summary>


    private void Awake()
    {
        Debug.Log("Hey");



        arKitPlaneRenderers = new List <GameObject>();

        //Initialize global reference to this script
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Debug.LogError("Make sure there is only one Manager Script in the scene!");
            //Delete this object
            Destroy(gameObject);
        }

        DeActivateAllObjs(worlds);

        //JUST FOR TESTING
        //RevealItems(scr,thresh, this.gameObject, tempType);
        //Debug.Log("Object revealed!");
    }
Exemplo n.º 18
0
    // Start is called before the first frame update
    void Start()
    {
        manager = FindObjectOfType <ManagerScript>();
        health  = GetComponent <UNITinfo>().health;
        uninfo  = GetComponent <UNITinfo>();

        uninfo.iscommandcenter = true;
    }
Exemplo n.º 19
0
 void Start()
 {
     manager      = GameObject.Find("GameManagerObject").GetComponent <ManagerScript>();
     bgImg        = GameObject.Find("Background").GetComponent <Image>();
     rect         = new Rect(0f, 0f, Screen.width, Screen.height);
     bgSprite     = Sprite.Create(manager.snapShotTex, rect, new Vector2(0f, 0f));
     bgImg.sprite = bgSprite;
 }
    // Use this for initialization
    void Start()
    {
        circular = GetComponent<CircularScript>();
        manager = GetComponent<ManagerScript>();

        maxFar = (circular.length / 2f) + (circular.length * (circular.plateCount - 1));
        Invoke("StartWave", manager.timeToBegin);
    }
Exemplo n.º 21
0
 // Start is called before the first frame update
 void Start()
 {
     HP           = GetComponent <HealthSystem>();
     rb           = GetComponent <Rigidbody2D>();
     manager      = ManagerScript.Instance;
     srender      = GetComponent <SpriteRenderer>();
     acheivements = AcheivementScript.Instance;
 }
Exemplo n.º 22
0
    // Start is called before the first frame update
    void Start()
    {
        managerScript = GameObject.FindGameObjectWithTag("GameManager").GetComponent <ManagerScript>();
        float curX = gameObject.transform.position.x;

        currentState      = State.Right; // Move right first
        currentFrameCount = 0;
    }
Exemplo n.º 23
0
 // Use this for initialization
 void Awake()
 {
     manager = GameObject.Find("Manager").GetComponent <ManagerScript>();
     if (destroyBlock == null)
     {
         destroyBlock = GameObject.Find("Manager").GetComponent <DestroyBlockScript>();
     }
 }
Exemplo n.º 24
0
 void Start()
 {
     note          = GetComponent <AudioSource> ();
     managerScript = manager.GetComponent <ManagerScript>();
     portrait      = GetComponent <Drop> ();
     animStars     = stars.GetComponent <Animator> ();
     isCorrect     = false;
 }
    // Use this for initialization
    void Start()
    {
        circular = GetComponent <CircularScript>();
        manager  = GetComponent <ManagerScript>();

        maxFar = (circular.length / 2f) + (circular.length * (circular.plateCount - 1));
        Invoke("StartWave", manager.timeToBegin);
    }
Exemplo n.º 26
0
 void Start()
 {
     manager  = GameObject.Find("GameManagerObject").GetComponent <ManagerScript>();
     ARCam    = CameraDevice.Instance;
     ui       = GameObject.Find("Canvas");
     pic      = new Texture2D(Screen.width, Screen.height);
     savePath = Application.temporaryCachePath;
 }
Exemplo n.º 27
0
 void Awake()
 {
     if (instance == null) {
         instance = this;
     } else if (instance != this) {
             Destroy(gameObject);
         }
 }
Exemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     //managerSingleton = GameObject.FindGameObjectWithTag ("ManagerSingleton");
     managerScript = manager.GetComponent <ManagerScript> ();
     dir           = -1;
     playerRB      = gameObject.GetComponent <Rigidbody2D>();
     initPos       = playerRB.position;
 }
Exemplo n.º 29
0
 // Use this for initialization
 void Start()
 {
     gameManager    = ManagerScript.Instance;
     enemyPlanets   = gameManager.enemyPlanets;
     thinkTimer     = 0.0f;
     action         = 0;
     actionHappened = false;
 }
Exemplo n.º 30
0
    // Use this for initialization
    void Start()
    {
        // get manager
        mScriptManager = GameObject.Find("ManagerScriptObject").GetComponent <ManagerScript> ();

        // save start positions
        startPosition = transform.position;
        startRotation = transform.rotation;
    }
    // Use this for initialization
    void Start()
    {
        laneIndex = 0;
        changing = false;

        manager = GetComponent<ManagerScript>();
        anim = car.GetComponent<Animator>();
        anim.SetInteger("Turning", -1);
    }
Exemplo n.º 32
0
    protected override void OnActivate()
    {
        AbstractPlanet planet = targetGameObject.GetComponent <AbstractPlanet> ();

        reactor     = planet.GetComponent <ReactorPlanetScript>();
        ownership   = planet.planetOwnership;
        gameManager = ManagerScript.Instance;
        CheckForUpdate();
    }
Exemplo n.º 33
0
    void OnTriggerEnter2D(Collider2D other)
    {
        //Invoke ("FightEnable", 0.1f);
        CellScript otherCell = other.gameObject.GetComponent <CellScript> ();

        //	if ((Gender == 0 && Gender != otherCell.Gender) && (Random.value > 0.1f)) {
        if (Sexuality > Rage)
        {
            //Fighting = false;
            Collider2D MotherColl = GetComponent <Collider2D>();
            MotherColl.enabled = false;

            GameObject    man       = GameObject.Find("Manager");
            ManagerScript manScript = man.GetComponent <ManagerScript> ();

            //spawn a baby with values inherited in a random range between the values of mother and father
            manScript.BirthPosition   = transform.position + new Vector3(-RandomX * 2, -RandomY * 2, 0.0f);
            manScript.ChildHealth     = Random.Range(otherCell.Health, Health);
            manScript.ChildRage       = Random.Range(otherCell.Health, Health);
            manScript.ChildStrength   = Random.Range(otherCell.Strength, Strength);
            manScript.ChildSexuality  = Random.Range(otherCell.Sexuality, Sexuality);
            manScript.ChildSpeed      = Random.Range(otherCell.moveSpeed, moveSpeed);
            manScript.ChildPerception = Random.Range(otherCell.Perception, Perception);
            manScript.ChildID         = ID + otherCell.ID;
            manScript.ChildGenID      = GenerationID += 1;
            manScript.SpawnChild();
            Debug.Log(ID + " gave birth to " + otherCell.ID + "'s baby: " + manScript.ChildID + " generation " + manScript.ChildGenID);

            // transform the mother so it won't get eaten by the kid or the other way around
            Vector3 afterbirthPos = transform.position + new Vector3(RandomX * 2, RandomY * 2, 0.0f);
            transform.position = afterbirthPos;
            Sexuality         -= 1;
            Rage += 1;
            Invoke("NoImmunity", 0.5f);
        }
        else
        {
            if (Strength > otherCell.Strength)
            {
                Health += otherCell.Health / 2;
                //Strength += 1;
                Debug.Log(ID + " killed " + otherCell.ID);
                if (Health < 100)
                {
                    transform.localScale = new Vector3(Health, Health, 0);
                }
                else
                {
                    Health = 100;
                    transform.localScale = new Vector3(Health, Health, 0);
                }
                Destroy(other.gameObject);
                Rage      -= 1;
                Sexuality += 1;
            }
        }
    }
Exemplo n.º 34
0
 // Use this for initialization
 void Start()
 {
     SoundLevelSlider = GameObject.Find("SoundLevelSlider").GetComponent<Slider>();
     MANAGER = GameObject.Find("_Manager").GetComponent<ManagerScript>();
     MainCamera = GameObject.Find("MainCamera");
     GrannyCam = GameObject.Find("GRANNYCAM");
     Noise = MainCamera.GetComponent<NoiseAndScratches>();
     Trippy = MainCamera.GetComponent<VignetteAndChromaticAberration>();
     granny = GameObject.Find("GRANNY");
     door = GameObject.Find("GRANNYDOOR");
     player = GameObject.Find("PLAYER");
     GrannySpot = GameObject.Find("GRANNYSPOT");
 }
    // Use this for initialization
    void Start()
    {
        /*
        float i1 = speed / 10f;
        float i2 = length / 10f;

        int count = (int)(i1 * i2);
        */

        int count = plateCount;
        for (int i = 0; i < count; i++)
        {
            int index = Random.Range(0, platePrefabs.Count);
            GameObject p = Instantiate(platePrefabs[index], new Vector3(0, 0, i * length), Quaternion.identity) as GameObject;
            plates.Add(p);
        }

        manager = GetComponent<ManagerScript>();
    }
Exemplo n.º 36
0
 void Start()
 {
     mgrScript = GameObject.Find("ManagerGO").GetComponent<ManagerScript>();
 }
Exemplo n.º 37
0
 // Use this for initialization
 void Start()
 {
     MaxEnemy = 3;
     EnemyCount = 0;
     Manager = this;
     Score = 0;
 }
	void Update () {
		if(StartButtonScript.status == -1 && !started){
			if(File.Exists(filePath)){
				c = Color.yellow;
				
				string[] s = new string[size/**3*/];
				s = File.ReadAllLines(filePath);
				
				for(int i =0; i< size;i++){
					star[i] = int.Parse(s[i]);
				}
			}
			else{
				c = Color.magenta;
				string[] s = new string[size/**3*/];
				for(int i=0;i<s.Length;i++){
					s[i] = 0+""; 
				}
				File.WriteAllLines(filePath, s);
				
			}

			loadlevelScreen(false,0);
			StartButtonScript.status = 0;

		}
		else if(StartButtonScript.status == -2 || Input.GetKeyDown (KeyCode.Escape)){
			LevelManager.playing = false;
			if(!started && !resetMode  && inStartScreen){
				Application.Quit();
			}
			else if(!started && !resetMode  && !inStartScreen && !isNext){
				isNext = false;
				for(int i=0;i<size/2;i++){
					Destroy(levelSelect[i]);
					Destroy(levelNumber[i]);
				}
				Destroy(next);
				Destroy(modeChange);
				Destroy(tCamera);
				loadStartScreen();
			}
			else if((started && !resetMode) ){
				ManagerScript managerScript = craft.GetComponent<ManagerScript>();
				managerScript.levelManager.destroy();

				managerScript.destroy();
				Destroy(craft);
				Destroy(controls);
				loadStartScreen();
				loadlevelScreen(false,0);
				isNext = false;
				started= false;
			}
			else if(isNext){
				isNext = false;
				for(int i=0;i<size/2;i++){
					Destroy(levelSelect[i]);
					Destroy(levelNumber[i]);
				}
				Destroy(next);
				Destroy(modeChange);
				loadlevelScreen(false,0);
			}

			LaserScript.state = false;
			ShieldScript.state = false;
			ScoreScript.state = false;
			LevelManager.levelDone = false;
			StartButtonScript.status = 0;
		}
		else if(StartButtonScript.status == -3){
			if(!resetMode && !started){
				resetMode = true;
				enterConfirmScreen();
			}
			StartButtonScript.status = 0;
		}
		else if(StartButtonScript.status == -4){
			isNext = true;
			for(int i=0;i<size/2;i++){
				Destroy(levelSelect[i]);
				Destroy(levelNumber[i]);
			}
			Destroy(next);
			loadlevelScreen(true,size/2);
			StartButtonScript.status = 0;
		}
		else if(StartButtonScript.status >0 && !started && !resetMode){
			started = true;
			loadGame();
			managerScriptUse = craft.GetComponent<ManagerScript>();
			StartButtonScript.status = 0;


		}

		if (resetMode){
			if(ConfirmScript.confimed!=0){
				if(ConfirmScript.confimed==1){
					File.Delete(filePath);
					for( int i=0;i<size;i++){
						star[i] = 0;
					}
					exitConfirmScreen();
					resetMode = false;
				}
				if(ConfirmScript.confimed==2){
					exitConfirmScreen();
					resetMode = false;
				}
			}
		}//if resetMode
		if(started){
			if(managerScriptUse.levelManager!=null)
				if(LevelManager.levelStarScore>0){
					if(star[managerScriptUse.levelManager.preLevel-1]<LevelManager.levelStarScore){
						star[managerScriptUse.levelManager.preLevel-1] = LevelManager.levelStarScore;
					}
					LevelManager.levelStarScore = 0;

					string[] s = new string[size/**3*/];

					for(int i =0;i<s.Length;i++){
						s[i] = star[i]+"";
					}
				File.WriteAllLines(filePath,s);
				}
		}//if started


	}
Exemplo n.º 39
0
 void Start()
 {
     manager = gameObject.GetComponent<ManagerScript>();
     serverView = GameObject.Find("Main").GetComponent<NetworkView>();
 }