Пример #1
0
        // Use this for initialization
        void Start()
        {
            //REFERENCES (ENFANT)
            if (this.GetComponentInParent <BoatCharacter>() != null)
            {
                _boatCharacter = this.GetComponentInParent <BoatCharacter>();
            }
            else
            {
                Debug.Log("AnimationBoat --> Start / there is no BoatCharacter in parent");
            }
            if (_transformParent == null)
            {
                Debug.Log("AnimationBoat --> Start / transformParent est null");
            }

            _transformMesh = this.GetComponent <Transform>();
        }
        public void InitLocalBoat()
        {
            //Guillaume 30-12-2019 11h15 --> il ne me faut pas le gameObject mais le script/composant : PlayerController
            //_joystick = GameObject.Find("FondJoystick");
            //_playerController = GameObject.Find("FondJoystick").GetComponent<ProjetPirate.Controllers.PlayerController>();
            _playerController = FindObjectOfType <ProjetPirate.Controllers.PlayerController>();
            if (_playerController == null)
            {
                Debug.Log(this.name + " --> InitLocalBoat / _playerController est null");
            }
            _boatCharacter = this.GetComponent <BoatCharacter>();
            if (_boatCharacter == null)
            {
                Debug.Log(this.name + " --> InitLocalBoat / _boatCharacter est null");
            }

            _playerController.SetBoatCharacterReference(_boatCharacter);

            _buttonShootUp    = GameObject.Find("ButtonShootUp");
            _buttonShootLeft  = GameObject.Find("ButtonShootLeft");
            _buttonShootRight = GameObject.Find("ButtonShootRight");


            this.gameObject.GetComponent <BoatCharacter>().CmdSetUpBoat(_player.gameObject);

            _cameraPivot    = CameraPivot.Instance.transform;
            _cameraPosition = CameraPosition.Instance.transform;
            Vector3 pos = _cameraPosition.localPosition;

            pos *= _zoom;
            Camera.main.transform.localPosition = pos;

            if (_player == null)
            {
                Debug.Log("Player Null in boat controller");
            }
        }
Пример #3
0
 public void SetOwner(ProjetPirate.Boat.BoatCharacter pOwner)
 {
     _owner = pOwner;
 }