예제 #1
0
 void OnCollisionExit2D(Collision2D collision)
 {
     this.InteractingObject = null;
     InteractingWith        = null;
     Interacting            = false;
     StoveInteractingWith   = null;
     StoveInteracting       = false;
 }
예제 #2
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        print(this.name + " has collided with " + collision.collider.name);

        // Get the interaction object if it exists
        this.InteractingWith   = collision.collider.GetComponent <Interaction>();
        this.InteractingObject = collision.collider.gameObject;
        if (InteractingWith != null)
        {
            Interacting = true;
        }
        // Or Get stove
        this.StoveInteractingWith = collision.collider.GetComponent <StoveScript>();
        if (StoveInteractingWith != null)
        {
            StoveInteracting = true;
        }
    }
예제 #3
0
//    private int totalWallCnt = 6;
//    private int currentWallCnt = 6;
//    private int currentHP;
//    private Image HPBarImage;


    // Use this for initialization
    void Awake()
    {
        instance = this;
//        currentHP = (totalWallCnt - 1) * HpPerWall;
//        HPBarImage = HPBar.GetComponent<Image>();
    }