protected override void Start()
        {
            shooterManager = GetComponent <vShooterManager>();

            base.Start();

            if (GameController.Instance.IsMultyPlayer())
            {
                if (!isLocalPlayer)
                {
                    Destroy(this);
                    return;
                }
            }

            leftHand          = animator.GetBoneTransform(HumanBodyBones.LeftHand);
            rightHand         = animator.GetBoneTransform(HumanBodyBones.RightHand);
            leftUpperArm      = animator.GetBoneTransform(HumanBodyBones.LeftUpperArm);
            rightUpperArm     = animator.GetBoneTransform(HumanBodyBones.RightUpperArm);
            onlyArmsLayer     = animator.GetLayerIndex("OnlyArms");
            aimAngleReference = new GameObject("aimAngleReference");
            aimAngleReference.transform.rotation = transform.rotation;
            var chest = animator.GetBoneTransform(HumanBodyBones.Chest);

            aimAngleReference.transform.SetParent(chest);
            aimAngleReference.transform.localPosition = Vector3.zero;

            headTrack = GetComponent <vHeadTrack>();

            if (!controlAimCanvas)
            {
                Debug.LogWarning("Missing the AimCanvas, drag and drop the prefab to this scene in order to Aim", gameObject);
            }
        }
        public override void OnInspectorGUI()
        {
            vShooterManager manager = (vShooterManager)this.target;

            base.OnInspectorGUI();
            var color = GUI.color;

            if (Application.isPlaying && manager.tpCamera)
            {
                GUI.color = Color.red;
                EditorGUILayout.BeginVertical(skin.box);
                GUI.color = color;
                EditorGUILayout.HelpBox("Playmode Debug - Equip a weapon first", MessageType.Info);
                EditorGUILayout.Space();

                if (GUILayout.Button(manager.tpCamera.lockCamera ? "Unlock Camera" : "Lock Camera", EditorStyles.toolbarButton))
                {
                    manager.tpCamera.lockCamera = !manager.tpCamera.lockCamera;
                }
                EditorGUILayout.Space();
                if (GUILayout.Button(manager.alwaysAiming ? "Unlock Aiming" : "Lock Aiming", EditorStyles.toolbarButton))
                {
                    manager.alwaysAiming = !manager.alwaysAiming;
                }
                EditorGUILayout.Space();
                if (GUILayout.Button(manager.showCheckAimGizmos ? "Hide Aim Gizmos" : "Show Aim Gizmos", EditorStyles.toolbarButton))
                {
                    manager.showCheckAimGizmos = !manager.showCheckAimGizmos;
                }
                EditorGUILayout.EndVertical();
            }
            GUI.color = color;
        }
Ejemplo n.º 3
0
        public void CreateNewIKAdjustList(vShooterManager targetShooterManager)
        {
            vWeaponIKAdjustList ikAdjust = ScriptableObject.CreateInstance <vWeaponIKAdjustList>();

            AssetDatabase.CreateAsset(ikAdjust, "Assets/" + manager.gameObject.name + "@IKAdjustList.asset");
            targetShooterManager.weaponIKAdjustList = ikAdjust;
            AssetDatabase.SaveAssets();
        }
Ejemplo n.º 4
0
        protected override void AdditionalGUI()
        {
            if (!manager)
            {
                manager = (vShooterManager)this.target;
            }

            var color = GUI.color;

            if (toolbars[selectedToolBar].title.Equals("IK Adjust"))
            {
                if (!Application.isPlaying && GUILayout.Button("Create New IK Adjust List"))
                {
                    CreateNewIKAdjustList(manager);
                }

                if (manager.weaponIKAdjustList != null && GUILayout.Button("Edit IK Adjust List"))
                {
                    vShooterIKAdjustWindow.InitEditorWindow();
                }
            }

            if (Application.isPlaying)
            {
                if (manager.tpCamera)
                {
                    GUI.color   = Color.red;
                    GUI.color   = color;
                    GUI.enabled = vShooterIKAdjustWindow.curWindow == null;
                    GUI.enabled = true;

                    EditorGUILayout.Space();
                    if (GUILayout.Button(manager.showCheckAimGizmos ? "Hide Aim Gizmos" : "Show Aim Gizmos", EditorStyles.toolbarButton))
                    {
                        manager.showCheckAimGizmos = !manager.showCheckAimGizmos;
                    }
                }
            }

            GUI.color = color;
        }
 // Start is vChangeWeapon before the first frame update
 void Start()
 {
     WeaponController = GetComponent <Invector.vShooter.vShooterManager>();
     //GetComponent<Invector.vCharacterController.TopDownShooter.vTopDownShooterInput>().enabled = false;
     //GetComponent<Invector.vCharacterController.TopDownShooter.vTopDownController>().enabled = false;
 }