add ckg
plantilla base para movimiento básico
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cb9c5a4abbf19f458f31e76716a369e
|
||||
folderAsset: yes
|
||||
timeCreated: 1658269931
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class characterSlowDownVelocity : characterStateAffectedInfo
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public bool animationSpeedCanBeChanged = true;
|
||||
|
||||
public playerController mainPlayerController;
|
||||
|
||||
public override void activateStateAffected (float stateDuration, float stateAmount)
|
||||
{
|
||||
if (animationSpeedCanBeChanged) {
|
||||
if (mainPlayerController.usedByAI) {
|
||||
mainPlayerController.setNewAnimSpeedMultiplierDuringXTime (stateDuration);
|
||||
mainPlayerController.setReducedVelocity (stateAmount);
|
||||
|
||||
if (stateAmount < 0.09f) {
|
||||
mainPlayerController.setCanMoveAIState (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2cd5c6eb833901047a911e5facc20c8c
|
||||
timeCreated: 1622030965
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/States/Examples/characterSlowDownVelocity.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class freezeCharacterState : characterStateAffectedInfo
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public playerController mainPlayerController;
|
||||
|
||||
public int pauseCharacterPriority = 2;
|
||||
|
||||
public override void activateStateAffected (bool state)
|
||||
{
|
||||
GKC_Utils.pauseOrResumeCharacter (state, mainPlayerController, pauseCharacterPriority);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fc7b51b556a889459c719994ea261c5
|
||||
timeCreated: 1658270083
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/States/Examples/freezeCharacterState.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,75 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class characterPropertiesSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool characeterStatesAffectedEnabled = true;
|
||||
|
||||
[Space]
|
||||
[Header ("States List Settings")]
|
||||
[Space]
|
||||
|
||||
public List<characterStateAffectedInfo> characterStateAffectedInfoList = new List<characterStateAffectedInfo> ();
|
||||
|
||||
public void activateStateAffected (string stateName, float stateDuration, float stateAmount)
|
||||
{
|
||||
if (!characeterStatesAffectedEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < characterStateAffectedInfoList.Count; i++) {
|
||||
if (characterStateAffectedInfoList [i].stateAffectedName.Equals (stateName) && characterStateAffectedInfoList [i].stateEnabled) {
|
||||
characterStateAffectedInfoList [i].activateStateAffected (stateDuration, stateAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void activateStateAffected (string stateName)
|
||||
{
|
||||
activateOrDeactivateStateAffected (stateName, true);
|
||||
}
|
||||
|
||||
public void deactivateStateAffected (string stateName)
|
||||
{
|
||||
activateOrDeactivateStateAffected (stateName, false);
|
||||
}
|
||||
|
||||
public void activateOrDeactivateStateAffected (string stateName, bool state)
|
||||
{
|
||||
if (!characeterStatesAffectedEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < characterStateAffectedInfoList.Count; i++) {
|
||||
if (characterStateAffectedInfoList [i].stateAffectedName.Equals (stateName) && characterStateAffectedInfoList [i].stateEnabled) {
|
||||
characterStateAffectedInfoList [i].activateStateAffected (state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public characterStateAffectedInfo getCharacterStateAffectedInfoByName (string stateName)
|
||||
{
|
||||
for (int i = 0; i < characterStateAffectedInfoList.Count; i++) {
|
||||
if (characterStateAffectedInfoList [i].stateAffectedName.Equals (stateName)) {
|
||||
return characterStateAffectedInfoList [i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public GameObject getCharacterStateAffectedInfoGameObjectByName (string stateName)
|
||||
{
|
||||
for (int i = 0; i < characterStateAffectedInfoList.Count; i++) {
|
||||
if (characterStateAffectedInfoList [i].stateAffectedName.Equals (stateName)) {
|
||||
return characterStateAffectedInfoList [i].gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6cc0a5efa97ea041839dfbc72d5a0e3
|
||||
timeCreated: 1610744723
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/States/characterPropertiesSystem.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class characterStateAffectedInfo : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool stateEnabled = true;
|
||||
|
||||
public string stateAffectedName;
|
||||
|
||||
public bool stateAffectedActive;
|
||||
|
||||
public virtual void activateStateAffected (float stateDuration, float stateAmount)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void activateStateAffected (bool state)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool isStateAffectedActive ()
|
||||
{
|
||||
return stateAffectedActive;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51400dd25d523fb47803fbb20eaf59ce
|
||||
timeCreated: 1622030505
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/States/characterStateAffectedInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class setCharacterAffectedState : MonoBehaviour
|
||||
{
|
||||
public bool affectStateEnabled = true;
|
||||
|
||||
public string characterStateAffectedName;
|
||||
|
||||
public float stateDuration;
|
||||
|
||||
public float stateAmount;
|
||||
|
||||
public void checkObjectDetected (GameObject objectToDamage)
|
||||
{
|
||||
if (!affectStateEnabled || objectToDamage == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
playerComponentsManager mainPlayerComponentsManager = objectToDamage.GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (mainPlayerComponentsManager != null) {
|
||||
characterPropertiesSystem currentCharacterPropertiesSystem = mainPlayerComponentsManager.getCharacterPropertiesSystem ();
|
||||
|
||||
if (currentCharacterPropertiesSystem != null) {
|
||||
currentCharacterPropertiesSystem.activateStateAffected (characterStateAffectedName, stateDuration, stateAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8a68a0c76df7ba4c9c46c2e0259fa2c
|
||||
timeCreated: 1622032343
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Player/States/setCharacterAffectedState.cs
|
||||
uploadId: 814740
|
||||
Reference in New Issue
Block a user