Пример #1
0
    void Awake()
    {
        Rigid       = GetComponent <Rigidbody2D>();
        Instance    = GetComponent <ActorInstance>();
        ActorAttack = GetComponent <ActorAttack>();

        if (Rigid == null)
        {
            Rigid = this.gameObject.AddComponent <Rigidbody2D>();
            Rigid.freezeRotation = true;
        }

        Collider         = GetComponent <BoxCollider2D>();
        Collider.enabled = true;

        Anim = transform.Find("Body").GetComponent <Animator>();
    }
Пример #2
0
 void Start()
 {
     animator      = this.GetComponent <Animator>();
     actorMovement = this.GetComponent <ActorMovement>();
     actorAttack   = this.GetComponent <ActorAttack>();
 }
Пример #3
0
 void Start()
 {
     animator = this.GetComponent<Animator>();
     actorMovement = this.GetComponent<ActorMovement>();
     actorAttack = this.GetComponent<ActorAttack>();
 }