示例#1
0
        private void Start()
        {
            thisCamera = Camera.main;
            //CameraClipPlanePoint(thisCamera.nearClipPlane);
            player = Character.GetComponent <Player_Movement>();

            transform.localPosition       = offset.idle;
            CameraTransform.localPosition = transform.localPosition;
            offset.mirrorAiming           = new Vector3(-offset.Aiming.x, offset.Aiming.y, offset.Aiming.z);
            collisionLayer = LayerMask.GetMask("Wall") + LayerMask.GetMask("Map");
        }
示例#2
0
        private void Start()
        {
            //Cursor.lockState = CursorLockMode.Locked;
            //Cursor.visible = false;

            playermovement = Character.GetComponent <Player_Movement>();
            footPlacement  = Character.GetComponent <HumanoidVerticalLegPlacement>();

            characterIK = Character.GetComponent <Player_IK>();

            weaponManager = Character.GetComponent <Player_WeaponAnimation>();
        }
示例#3
0
        void Start()
        {
            transform.position = CameraPivot.localPosition;
            Vector3 rot = transform.localRotation.eulerAngles;

            rotY = rot.y;
            rotX = rot.x;

            //Cursor.lockState = CursorLockMode.Locked;
            //Cursor.visible = false;

            originalVec = CameraPivot.localPosition;

            playerMovement = Character.GetComponent <Player_Movement>();
        }
示例#4
0
        // Unity's Methods
        //---------
        // Use this for initialization
        void Start()
        {
            m_MovementController = GetComponent <Player_Movement>();

            // Set mutations
            m_AllowPlayerMovement = false;
            m_AllowPLayerLook     = true;
            m_AllowPlayerAttack   = false;

            m_Duration    = 1f; // debug value, load this using a settings mechanic later (.4 seems about right, maybe even .3 )
            m_Speed       = 20f;
            m_SpeedFallof = 1f;

            // add the knockback particle effect
            m_particleEffectObject = (GameObject)Instantiate(Resources.Load(m_particleEffectName), transform.position + Vector3.up * .3f, transform.rotation);
            m_particleEffectObject.transform.parent = this.transform;
        }
示例#5
0
        // Unity's Methods
        //---------
        // Use this for initialization
        void Start()
        {
            m_MovementController = GetComponent<Player_Movement>();

            // Set mutations
            m_AllowPlayerMovement = false;
            m_AllowPLayerLook = true;
            m_AllowPlayerAttack = false;

            m_Duration = 1f; // debug value, load this using a settings mechanic later (.4 seems about right, maybe even .3 )
            m_Speed = 20f;
            m_SpeedFallof = 1f;

            // add the knockback particle effect
            m_particleEffectObject = (GameObject) Instantiate( Resources.Load(m_particleEffectName) , transform.position +  Vector3.up * .3f , transform.rotation );
            m_particleEffectObject.transform.parent = this.transform;
        }
        private void Start()
        {
            anim  = GetComponent <Animator>();
            state = GetComponent <Player_Movement>();

            shoulder = anim.GetBoneTransform(HumanBodyBones.RightUpperArm).transform;

            aimPivot                  = new GameObject().transform;
            aimPivot.name             = "aim_pivot";
            aimPivot.transform.parent = transform;

            r_Hand                  = new GameObject().transform;
            r_Hand.name             = "right_hand";
            r_Hand.transform.parent = aimPivot;

            l_Hand                  = new GameObject().transform;
            l_Hand.name             = "left_hand";
            l_Hand.transform.parent = aimPivot;

            Main_Weapon_Setting();
            Sub_Weapon_Setting();
            Third_Weapon_Setting();
            Right_hand_setting();
        }
示例#7
0
 // Use this for initialization
 void Start()
 {
     m_playerMovement = GetComponentInParent<Player_Movement>();
     m_particleSystem = GetComponent<ParticleSystem>();
 }
示例#8
0
        private void Start()
        {
            playermovement = GetComponent <Player_Movement>();
            allyController = GetComponent <AllyController>();
            weaponManager  = GetComponent <WeaponManager>();

            originMainPose = weaponManager.m_MainWeaponObject.transform.localPosition;
            originMainRot  = weaponManager.m_MainWeaponObject.transform.localRotation.eulerAngles;

            originSubPose = weaponManager.m_SubWeaponObject.transform.localPosition;
            originSubRot  = weaponManager.m_SubWeaponObject.transform.localRotation.eulerAngles;


            if (playermovement != null)
            {
                switch (playermovement.p_Wstate)
                {
                case WEAPON_STATE.MAIN_WEAPON:
                    weaponManager.m_SubWeaponObject.transform.SetParent(Pose_SubWeapon.transform);
                    weaponManager.m_SubWeaponObject.transform.localPosition = Vector3.zero;
                    weaponManager.m_SubWeaponObject.transform.localRotation = Quaternion.Euler(Vector3.zero);
                    break;

                case WEAPON_STATE.SUB_WEAPON:
                    weaponManager.m_MainWeaponObject.transform.SetParent(Pose_MainWeapon.transform);
                    weaponManager.m_MainWeaponObject.transform.localPosition = Vector3.zero;
                    weaponManager.m_MainWeaponObject.transform.localRotation = Quaternion.Euler(Vector3.zero);
                    break;
                }
            }

            else if (allyController != null)
            {
                if (allyController.weaponType == WeaponType.MainWeapon)
                {
                    weaponManager.m_SubWeaponObject.transform.SetParent(Pose_SubWeapon.transform);
                    weaponManager.m_SubWeaponObject.transform.localPosition = Vector3.zero;
                    weaponManager.m_SubWeaponObject.transform.localRotation = Quaternion.Euler(Vector3.zero);
                }
                else
                {
                    weaponManager.m_MainWeaponObject.transform.SetParent(Pose_MainWeapon.transform);
                    weaponManager.m_MainWeaponObject.transform.localPosition = Vector3.zero;
                    weaponManager.m_MainWeaponObject.transform.localRotation = Quaternion.Euler(Vector3.zero);
                }
            }

            //weaponManager.m_MainWeaponObject.SetActive(true);
            //weaponManager.m_SubWeaponObject.SetActive(true);

            Bomb = Resources.Load("Character/Skill/Bomb") as GameObject;
            int count;

            if (weaponManager.m_MainWeapon == "006" || weaponManager.m_MainWeapon == "008")
            {
                count    = weaponManager.m_MainWeaponObject.transform.childCount - 2;
                main_Mag = weaponManager.m_MainWeaponObject.transform.GetChild(count).gameObject;
            }

            else
            {
                count    = weaponManager.m_MainWeaponObject.transform.childCount - 1;
                main_Mag = weaponManager.m_MainWeaponObject.transform.GetChild(count).gameObject;
            }

            count   = weaponManager.m_SubWeaponObject.transform.childCount - 1;
            sub_Mag = weaponManager.m_SubWeaponObject.transform.GetChild(count).gameObject;

            SettingMag();
        }
示例#9
0
 // Use this for initialization
 void Start()
 {
     m_playerMovement = GetComponentInParent <Player_Movement>();
     m_particleSystem = GetComponent <ParticleSystem>();
 }