예제 #1
0
    // Use this for initialization
    void Start()
    {
        weapons = GetComponentsInChildren <Weapon> ();
        foreach (var w in weapons)
        {
            w.gameObject.SetActive(false);
        }
        weapons[selected_weapon].gameObject.SetActive(true);

        if (char_type == CharType.NPC)
        {
            setup_normal_ki();
        }
        if (char_type == CharType.NPC_Melee)
        {
            setup_melee_ki();
        }



        rigid  = GetComponent <Rigidbody2D> ();
        render = GetComponent <SpriteRenderer> ();
        if (char_type == CharType.NPC || char_type == CharType.NPC_Melee)
        {
            if (npc_in_cover)
            {
                current_state = new NPCInCover();
            }
            else
            {
                current_state = new NPCStanding();
            }
            root.Activate(gameObject);
        }
        else
        {
            current_state = new PlayerStanding();
        }
    }