Esempio n. 1
0
    //WallThrough
    void PowerUp2()
    {
        UsePowerSound();
        RaycastHit[] hits;
        hits = Physics.RaycastAll(transform.position, transform.right, 20, WallLvalue);

        for (int i = 0; i < hits.Length; i++)
        {
            AllWall.Add(hits[i].transform.gameObject.transform.parent.gameObject);
        }

        for (int i = 0; i < AllWall.Count; i++)
        {
            WallsManager wallscript = AllWall[i].GetComponent <WallsManager>();
            wallscript.OpenWall = true;
            if (PositionToSend == "P1")
            {
                wallscript.material.SetInt("_Player1", 1);
            }
            else
            {
                wallscript.material.SetInt("_Player1", 0);
            }
        }
        StartCoroutine(ClearList());
    }
 protected virtual void Start()
 {
     wallsManager     = GameObject.Find("WallsManager").GetComponent <WallsManager>();
     enemyController  = GetComponent <EnemyController>();
     screenTopEdge    = ScreenPositionService.GetTopEdge(Camera.main);
     screenLeftEdge   = ScreenPositionService.GetLeftEdge(Camera.main);
     screenRightEdge  = ScreenPositionService.GetRightEdge(Camera.main);
     screenBottomEdge = ScreenPositionService.GetBottomEdge(Camera.main);
 }
Esempio n. 3
0
 public override void Awake()
 {
     base.Awake();
     Instance = this;
 }
Esempio n. 4
0
 void Awake()
 {
     Instance = this;
 }