Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player");
        anim   = GetComponent <Animator>();

        up    = GameObject.Find("HitboxUp");
        down  = GameObject.Find("HitboxDown");
        left  = GameObject.Find("HitboxLeft");
        right = GameObject.Find("HitboxRight");
        rb    = player.GetComponent <Rigidbody2D>();
        col   = player.GetComponent <BoxCollider2D>();
        up.SetActive(false);
        down.SetActive(false);
        left.SetActive(false);
        right.SetActive(false);

        refScript = right.GetComponent <OnTrigger2D>();
    }
 void Awake()
 {
     instance = this;
 }