Beispiel #1
0
 public void MoveF(Vector2 move)
 {
     if (!isWater)
     {
         transform.rotation = Quaternion.LookRotation(Vector3.forward, move);
         transform.Translate(move * m_MaxSpeed * Time.deltaTime, Space.World);
         Constrain();
         FireSpawner fspawn = this.GetComponent <FireSpawner>();
         fspawn.CmdFireSpew();
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        StateOfFire = 0;

        FS = GameObject.FindGameObjectWithTag("FireSpawnerObj").GetComponent <FireSpawner> ();

        posVect = FS.getPosVect();
        for (int i = 0; i < 9; i++)
        {
            if (gameObject.transform.position == posVect[i])
            {
                currentPos = i;
            }
        }
        isShooting = false;

        StartCoroutine(LifeCycle(1));
    }
Beispiel #3
0
    //Awake is always called before any Start functions
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }
        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }


        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        //Assign enemies to a new List of Enemy objects.
        enemies  = new List <Enemy>();
        housings = new List <Housing>();

        //Get a component reference to the attached BoardManager script
        boardScript = GetComponent <BoardManager>();

        // Get a component reference to the attached FireSpawner script
        fireSpawnerScript = GetComponent <FireSpawner>();

        GameObject MenuUI = GameObject.Find("Menu UI");

        if (MenuUI)
        {
            MenuUI.SetActive(false);
        }
        //uncomment this on standalone
        level = 1;
        InitGame();
        /////
    }