示例#1
0
    void Awake()
    {
        string gTiles = mapGrappleable.text;

        gTiles       = Utils.RemoveLineEndings(gTiles);
        grappleTiles = new List <int>();
        unsafeTiles  = new List <int>();
        for (int i = 0; i < gTiles.Length; i++)
        {
            switch (gTiles[i])
            {
            case 'S':
                grappleTiles.Add(i);
                break;

            case 'X':
                unsafeTiles.Add(i);
                break;
            }
        }

        dray      = GetComponent <Dray>();
        rigid     = GetComponent <Rigidbody>();
        anim      = GetComponent <Animator>();
        drayColld = GetComponent <Collider>();

        Transform trans = transform.Find("Grappler");

        grapHead = trans.gameObject;
        grapLine = grapHead.GetComponent <LineRenderer>();
        grapHead.SetActive(false);
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        sword = transform.Find("Sword").gameObject;
        dray  = transform.parent.GetComponent <Dray>();

        sword.SetActive(false);
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     sword = transform.Find("Sword").gameObject;                          // a
     dray  = transform.parent.GetComponent <Dray>();
     // Deactivate the sword
     sword.SetActive(false);
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        GameObject go = GameObject.Find("Dray");

        dray      = go.GetComponent <Dray>();
        drayColld = go.GetComponent <SphereCollider>();
    }
示例#5
0
    // Update is called once per frame
    override protected void Update()
    {
        base.Update();
        if (knockback)
        {
            return;
        }

        if (Time.time >= timeNextDecision)
        {
            DecideDirection();
        }

        //Only move if Dray is in the room
        GameObject d      = GameObject.Find("Dray");
        Dray       player = (Dray)d.GetComponent(typeof(Dray));

        if (player.GetRoomNum() == roomNum)
        {
            speed = 2;
        }
        else
        {
            speed = 0;
        }

        //rigid is inherited from Enemy and is initialized in Enemy.Awake()
        rigid.velocity = directions[facing] * speed;
    }
示例#6
0
 private void Start()
 {
     sword = transform.Find("Sword").gameObject;
     dray  = transform.parent.GetComponent <Dray>();
     // Деактивировать меч
     sword.SetActive(false);
 }
示例#7
0
 private GameObject sword; private Dray dray; void Start()
 {
     sword = transform.Find("Sword").gameObject;                            // a   
     dray  = transform.parent.GetComponent <Dray>();                        // Deactivate the sword    
     sword.SetActive(false);                                                // b
             
 }
示例#8
0
    // Use this for initialization
    void Start()
    {
        sword = transform.GetChild(0).gameObject;
        dray  = transform.parent.GetComponent <Dray> ();

        // Deactivate the sword
        sword.SetActive(false);
    }
示例#9
0
    void Start()
    {
        inRm = GetComponent <InRoom>();

        GameObject go = GameObject.Find("Dray");

        dray      = go.GetComponent <Dray>();
        drayColld = go.GetComponent <SphereCollider>();
        dEf       = GetComponent <DamageEffect>();
    }
示例#10
0
    void Awake()
    {
        dray      = GetComponent <Dray>();
        rigid     = GetComponent <Rigidbody2D>();
        anim      = GetComponent <Animator>();
        drayColld = GetComponent <Collider2D>();

        Transform trans = transform.Find("Grappler");

        grapHead = trans.gameObject;
        grapLine = grapHead.GetComponent <LineRenderer>();
        grapHead.SetActive(false);
    }
示例#11
0
 void Start()
 {
     sword = transform.Find("Sword").gameObject;
     dray  = transform.parent.GetComponent <Dray>();
     sword.SetActive(false);//did not work as false before, but changed it to true and now it works??
 }
示例#12
0
 public RunForLifeBehaviour(Enemy enemy, Dray dray)
 {
     this.enemy = enemy;
     this.dray  = dray;
 }
示例#13
0
 public BehaviourController(Enemy enemy, Dray dray)
 {
     this.enemy     = enemy;
     this.dray      = dray;
     this.behaviour = new RandomWalkBehaviour(enemy);
 }
 public AttackDrayBehaviour(Enemy enemy, Dray dray)
 {
     this.enemy = enemy;
     this.dray  = dray;
 }