gettin ready to spawn el monkeys
This commit is contained in:
parent
cd1b02b9a4
commit
dee467edb8
|
|
@ -7058,8 +7058,9 @@ GameObject:
|
|||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3735448262030941676}
|
||||
- component: {fileID: 8572779002997729184}
|
||||
m_Layer: 0
|
||||
m_Name: WatchHoles
|
||||
m_Name: MonkeyHandler
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -7140,6 +7141,20 @@ Transform:
|
|||
m_Father: {fileID: 7676047881968251921}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8572779002997729184
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1093165643910593156}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e0769f835f6039b41b98b9487eb743d9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
yellowMonkeyRef: {fileID: -9193613041847046406, guid: 224742d4a2c74034997943856f560054, type: 3}
|
||||
pinkMonkeyRef: {fileID: 8621594802119604348, guid: 277f8b23f1f26f64290a2461c18d4b80, type: 3}
|
||||
--- !u!1 &1093770155466988112
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -20240,6 +20255,7 @@ MonoBehaviour:
|
|||
cameraTransform: {fileID: 16600283237656001}
|
||||
cameraMoveable: {fileID: 7676047881968251921}
|
||||
monkeyClockArrow: {fileID: 8220690735241008560}
|
||||
monkeyHandler: {fileID: 8572779002997729184}
|
||||
maxMonkeys: 30
|
||||
--- !u!1 &6181011653585253546
|
||||
GameObject:
|
||||
|
|
@ -22881,6 +22897,9 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
anim: {fileID: 910339928251400446}
|
||||
anchorRotateTransform: {fileID: 609139906039373078}
|
||||
playerMonkeyAnim: {fileID: 4873567491568184609}
|
||||
yellowClap: {fileID: 8899231323861109608}
|
||||
pinkClap: {fileID: 5162462144302245337}
|
||||
--- !u!1 &7446072329631304920
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ PrefabInstance:
|
|||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: -9193613041847046406, guid: 224742d4a2c74034997943856f560054, type: 3}
|
||||
propertyPath: isPink
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 454223507615240516, guid: 224742d4a2c74034997943856f560054, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 0.7666345
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 7591110402097765485}
|
||||
- component: {fileID: 7211266264008123551}
|
||||
- component: {fileID: -9193613041847046406}
|
||||
m_Layer: 0
|
||||
m_Name: YellowMonkey
|
||||
m_TagString: Untagged
|
||||
|
|
@ -230,6 +231,19 @@ Animator:
|
|||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!114 &-9193613041847046406
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3151069026564347634}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 23217e6c428ce954e8fd08940b856233, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isPink: 0
|
||||
--- !u!1 &4343136497418508153
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -178,8 +178,9 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 2594505700513810575}
|
||||
- component: {fileID: 4157700164771259173}
|
||||
- component: {fileID: 6295735035881919980}
|
||||
m_Layer: 0
|
||||
m_Name: WatchHole
|
||||
m_Name: watchHole
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -223,3 +224,14 @@ Animator:
|
|||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!210 &6295735035881919980
|
||||
SortingGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8325540476350084961}
|
||||
m_Enabled: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
|
|
|
|||
|
|
@ -234,13 +234,13 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 490, y: 170, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 9034752867166180580}
|
||||
m_Position: {x: -350, y: 250, z: 0}
|
||||
m_Position: {x: -480, y: 140, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 2281978419273917628}
|
||||
m_Position: {x: -200, y: 270, z: 0}
|
||||
m_Position: {x: -350, y: 200, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -823361394144095262}
|
||||
m_Position: {x: -50, y: 250, z: 0}
|
||||
m_Position: {x: -210, y: 150, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -2720091023925718476}
|
||||
m_Position: {x: 260, y: 230, z: 0}
|
||||
|
|
@ -285,7 +285,7 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 490, y: 590, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -8633427497819712545}
|
||||
m_Position: {x: -200, y: 190, z: 0}
|
||||
m_Position: {x: -350, y: 40, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7801861347107792603}
|
||||
m_Position: {x: -165, y: 255, z: 0}
|
||||
|
|
@ -939,7 +939,7 @@ AnimatorState:
|
|||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Yellow
|
||||
m_Name: Prepare4
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
|
|
|
|||
|
|
@ -10,6 +10,24 @@ namespace HeavenStudio.Games.Scripts_MonkeyWatch
|
|||
[Header("Components")]
|
||||
[SerializeField] private Animator anim;
|
||||
[SerializeField] private Transform anchorRotateTransform;
|
||||
[SerializeField] private Animator playerMonkeyAnim;
|
||||
[SerializeField] private ParticleSystem yellowClap;
|
||||
[SerializeField] private ParticleSystem pinkClap;
|
||||
|
||||
private MonkeyWatch game;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
game = MonkeyWatch.instance;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
{
|
||||
PlayerClap(false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Move()
|
||||
{
|
||||
|
|
@ -21,6 +39,32 @@ namespace HeavenStudio.Games.Scripts_MonkeyWatch
|
|||
{
|
||||
anchorRotateTransform.localEulerAngles = new Vector3(0, 0, -angle);
|
||||
}
|
||||
|
||||
public void PlayerClap(bool big, bool barely, bool whiff)
|
||||
{
|
||||
if (!playerMonkeyAnim.IsAnimationNotPlaying() && whiff) return;
|
||||
|
||||
if (barely || whiff)
|
||||
{
|
||||
playerMonkeyAnim.DoScaledAnimationAsync("PlayerClapBarely", 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
playerMonkeyAnim.DoScaledAnimationAsync(big ? "PlayerClapBig" : "PlayerClap", 0.5f);
|
||||
if (big)
|
||||
{
|
||||
pinkClap.transform.eulerAngles = Vector3.zero;
|
||||
pinkClap.transform.GetChild(0).GetComponent<ParticleSystem>().SetAsyncScaling(0.5f);
|
||||
pinkClap.PlayScaledAsync(0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
yellowClap.transform.eulerAngles = Vector3.zero;
|
||||
yellowClap.transform.GetChild(0).GetComponent<ParticleSystem>().SetAsyncScaling(0.5f);
|
||||
yellowClap.PlayScaledAsync(0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,15 @@ namespace HeavenStudio.Games.Loaders
|
|||
{
|
||||
return new Minigame("monkeyWatch", "Monkey Watch", "f0338d", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("appear", "Monkeys Appear")
|
||||
{
|
||||
defaultLength = 2f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("value", new EntityTypes.Integer(1, 30, 4), "Repeat Amount")
|
||||
}
|
||||
},
|
||||
new GameAction("clap", "Clapping")
|
||||
{
|
||||
preFunction = delegate
|
||||
|
|
@ -85,11 +94,7 @@ namespace HeavenStudio.Games
|
|||
public class MonkeyWatch : Minigame
|
||||
{
|
||||
private const float degreePerMonkey = 6f;
|
||||
public enum WatchPoint
|
||||
{
|
||||
PersistGameSwitch,
|
||||
SetTime
|
||||
}
|
||||
|
||||
public static MonkeyWatch instance;
|
||||
|
||||
[Header("Components")]
|
||||
|
|
@ -97,6 +102,7 @@ namespace HeavenStudio.Games
|
|||
[SerializeField] private Transform cameraTransform;
|
||||
[SerializeField] private Transform cameraMoveable;
|
||||
[SerializeField] private MonkeyClockArrow monkeyClockArrow;
|
||||
[SerializeField] private WatchMonkeyHandler monkeyHandler;
|
||||
|
||||
[Header("Properties")]
|
||||
[SerializeField] private int maxMonkeys = 30;
|
||||
|
|
@ -124,6 +130,11 @@ namespace HeavenStudio.Games
|
|||
CameraUpdate();
|
||||
}
|
||||
|
||||
public void PlayerMonkeyClap(bool big, bool barely)
|
||||
{
|
||||
monkeyClockArrow.PlayerClap(big, barely, false);
|
||||
}
|
||||
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
GetCameraMovements(beat, false);
|
||||
|
|
|
|||
69
Assets/Scripts/Games/MonkeyWatch/WatchMonkey.cs
Normal file
69
Assets/Scripts/Games/MonkeyWatch/WatchMonkey.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Util;
|
||||
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_MonkeyWatch
|
||||
{
|
||||
public class WatchMonkey : MonoBehaviour
|
||||
{
|
||||
private Animator anim;
|
||||
private Animator holeAnim;
|
||||
[Header("Properties")]
|
||||
[SerializeField] private bool isPink;
|
||||
|
||||
private MonkeyWatch game;
|
||||
|
||||
private int direction = 0;
|
||||
|
||||
private PlayerActionEvent inputEvent;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
game = MonkeyWatch.instance;
|
||||
anim = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
public void Appear(bool instant, Animator hole)
|
||||
{
|
||||
holeAnim = hole;
|
||||
holeAnim.DoScaledAnimationAsync("HoleOpen", 0.5f);
|
||||
anim.DoScaledAnimationAsync(isPink ? "Pink" : "" + "Appear", 0.5f, instant ? 1 : 0);
|
||||
}
|
||||
|
||||
public void Prepare(double prepareBeat, double inputBeat, int dir)
|
||||
{
|
||||
direction = dir;
|
||||
anim.DoScaledAnimationAsync(isPink ? "Pink" : "" + "Prepare" + dir, 0);
|
||||
inputEvent = game.ScheduleInput(prepareBeat, inputBeat - prepareBeat, InputType.STANDARD_DOWN, Just, Miss, Empty);
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(prepareBeat, delegate
|
||||
{
|
||||
anim.DoScaledAnimationAsync(isPink ? "Pink" : "" + "Prepare" + dir, 0.5f);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
private void Just(PlayerActionEvent caller, float state)
|
||||
{
|
||||
game.PlayerMonkeyClap(isPink, state >= 1f || state <= -1f);
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
SoundByte.PlayOneShot("miss");
|
||||
return;
|
||||
}
|
||||
SoundByte.PlayOneShotGame(isPink ? "monkeyWatch/clapOffbeat" : $"monkeyWatch/clapOnbeat{UnityEngine.Random.Range(1, 6)}");
|
||||
anim.DoScaledAnimationAsync(isPink ? "Pink" : "" + "Clap" + direction, 0.5f);
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Empty(PlayerActionEvent caller) { }
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/Scripts/Games/MonkeyWatch/WatchMonkey.cs.meta
Normal file
11
Assets/Scripts/Games/MonkeyWatch/WatchMonkey.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 23217e6c428ce954e8fd08940b856233
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
31
Assets/Scripts/Games/MonkeyWatch/WatchMonkeyHandler.cs
Normal file
31
Assets/Scripts/Games/MonkeyWatch/WatchMonkeyHandler.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Util;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_MonkeyWatch
|
||||
{
|
||||
public class WatchMonkeyHandler : MonoBehaviour
|
||||
{
|
||||
[Header("Components")]
|
||||
[SerializeField] private WatchMonkey yellowMonkeyRef;
|
||||
[SerializeField] private WatchMonkey pinkMonkeyRef;
|
||||
|
||||
private MonkeyWatch game;
|
||||
|
||||
private int startMinute = 0;
|
||||
private double startBeat = 0;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
game = MonkeyWatch.instance;
|
||||
}
|
||||
|
||||
public void Init(double beat, int minute)
|
||||
{
|
||||
startBeat = beat;
|
||||
startMinute = minute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/Scripts/Games/MonkeyWatch/WatchMonkeyHandler.cs.meta
Normal file
11
Assets/Scripts/Games/MonkeyWatch/WatchMonkeyHandler.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e0769f835f6039b41b98b9487eb743d9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue