Пример #1
0
    void CharacterMovementUpdate(CharacterInputManage _CI)
    {
        if (Input.GetKey(_CI.MoveUp))
        {
            Vector3 position = this.transform.position;
            position.y += Speed;
            this.transform.position = position;
        }

        if (Input.GetKey(_CI.MoveDown))
        {
            Vector3 position = this.transform.position;
            position.y -= Speed;
            this.transform.position = position;
        }

        if (Input.GetKey(_CI.MoveRight))
        {
            Vector3 position = this.transform.position;
            position.x += Speed;
            this.transform.position = position;
        }

        if (Input.GetKey(_CI.MoveLeft))
        {
            Vector3 position = this.transform.position;
            position.x -= Speed;
            this.transform.position = position;
        }
    }
Пример #2
0
    void Start()
    {
        _CI     = GetComponent <CharacterInputManage>();
        FirePos = transform.GetChild(0).gameObject;

        //GetWeapon
        weapon = this.transform.GetComponentInChildren <Weapon>();
        //weapon.SetWeaponWithType(weaponType);
        SetWeaponGun();
        weapon.Owner = this.transform.gameObject;
    }
Пример #3
0
 void Start()
 {
     _CI = GetComponent <CharacterInputManage>();
     characterMovement = GetComponent <CharacterMovement>();
     characterFire     = GetComponent <CharacterFire>();
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     _CI = GetComponent <CharacterInputManage>();
 }