PlayerControl.SetInvisible C# (CSharp) Method

SetInvisible() public method

public SetInvisible ( ) : void
return void
    public void SetInvisible()
    {
        sprite.color = new Color(1f, 1f, 1f, 0f);
    }

Usage Example

 void OnTriggerEnter2D(Collider2D col)
 {
     //If the player collides with the patrolling enemy and not hiding
     if (col.gameObject.tag == "Player" && player.hide == false)
     {
         //Monster stops moving
         // speed = 0;
         //deactivate monster when colliding with player
         player.SetInvisible();
         StartCoroutine("SetInactive");
     }
 }
All Usage Examples Of PlayerControl::SetInvisible