示例#1
0
    public void OpenCage(TigerBoss boss)
    {
        Debug.Log("TigerBossCage :: OpenCage() - cage was opened");
        TigerTemplateBoss tiger = Instantiate(tigerTemplate);

        tiger.gameObject.SetActive(true);
        tiger.Init(boss);
        tiger.transform.position = transform.position;
        Destroy(this.gameObject);
    }
示例#2
0
    public void Init(TigerBoss boss)
    {
        var move = (boss.transform.position - transform.position).normalized;

        if (move.x > 0)
        {
            transform.rotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
        }
        else
        {
            transform.rotation = Quaternion.identity;
        }

        this.boss = boss;
        startTime = Time.time;
        attack    = true;
        if ((transform.position.x > boss.transform.position.x && !FacingRight) || transform.position.x < boss.transform.position.x && FacingRight)
        {
            Flip();
        }
    }