Beispiel #1
0
    protected void Awake()
    {
        GameManager.Instance.SetPlayer(this);

        rigid = GetComponent <Rigidbody2D>();

        shadow = transform.GetChild(0).gameObject;

        status         = StatusManager.Instance.GetStatus(UnitName);
        status.hp      = 100f;
        status.stamina = 100f;


        state = UnitState.Idle;

        ChildSetting(transform);

        //하위 컴포넌트 초기화
        {
            animator     = GetComponent <UnitAnimator>();
            attack       = GetComponent <UnitAttack>();
            movement     = GetComponent <UnitMovement>();
            colliderctrl = GetComponent <UnitColliderController>();

            animator.ConnectUnit(this);
            attack.ConnectUnit(this);
            movement.ConnectUnit(this);
            colliderctrl.ConnectUnit(this);
        }

        shadow.transform.parent = null;
        StartCoroutine(Shadow());
    }