コード例 #1
0
ファイル: Fish.cs プロジェクト: xrofng/Fisherman-Friend
    public void changeState(int i)
    {
        switch (i)
        {
        case 0: state = fState.swim;     break;

        case 1: state = fState.baited;   break;

        case 2:
            state     = fState.toPlayer;
            direction = holder.transform.position - transform.position;
            //veloY = 1;
            break;

        case 3: state = fState.hold;     break;
        }
    }
コード例 #2
0
ファイル: Fish.cs プロジェクト: xrofng/Fisherman-Friend
    public void playerCollideInteraction(GameObject player)
    {
        switch ((int)state)
        {
        case 0:
            break;

        case 1:
            break;

        case 2:
            state = fState.hold;
            Player p = player.GetComponent <Player>();
            this.gameObject.transform.parent = p.model.transform;
            p.holdingFish = true;
            p.state       = 0;
            break;

        case 3:
            break;
        }
    }