void Awake() { npc = GetComponent <Script_MovingNPC>(); player = game.GetPlayer(); origin = npc.transform.position; }
public void AutoSetup( Script_MovingNPC npc, List <Script_StaticNPC> NPCs, List <Script_MovingNPC> movingNPCs ) { NPCs.Add(npc); movingNPCs.Add(npc); npc.StaticNPCId = NPCs.Count - 1; npc.MovingNPCId = movingNPCs.Count - 1; }
private void OnTrigger() { if (game.Run.dayId == Script_Run.DayId.none) { game.PauseBgMusic(); if (game.GetNPCBgThemeActive()) { game.UnPauseNPCBgTheme(); } else { game.PlayNPCBgTheme(EroBgThemePlayerPrefab); } CacheMovingNPCMoves(0); game.ChangeStateCutSceneNPCMoving(); activeTriggerIndex++; if (activeTriggerIndex > 2) { isDone = true; } game.GetMovingNPC(0).ApproachTarget( game.GetPlayerLocation(), new Vector3(1f, 0, 0), Directions.Left, NPCEndCommands.None ); } // need this to save NPC moves since ForceMove will erase its moveSets void CacheMovingNPCMoves(int Id) { Script_MovingNPC npc = game.GetMovingNPC(Id); // Model_NPC NPCData = game.Levels.levelsData[game.level].NPCsData[Id]; // Model_MoveSet[] allMoveSets = NPCData.moveSets; // use GameObject, don't use gameData NPCData Model_MoveSet[] allMoveSets = moveSetsData.moveSets; truncatedMoveSet = new Model_MoveSet[ Mathf.Max(allMoveSets.Length - activeTriggerIndex - 1, 0) ]; for (int j = 0, k = activeTriggerIndex + 1; j < truncatedMoveSet.Length; j++, k++) { truncatedMoveSet[j] = allMoveSets[k]; } } }
public override void HandleMovingNPCOnApproachedTarget(int i) { if (game.Run.dayId == Script_Run.DayId.none) { dm.StartDialogueNode(TriggerNodes[activeTriggerIndex - 1]); RehydrateMovingNPCMoves(0); game.ChangeStateCutScene(); } void RehydrateMovingNPCMoves(int Id) { Script_MovingNPC npc = game.GetMovingNPC(Id); npc.moveSets = truncatedMoveSet; npc.QueueMoves(); } }
public void SetupMovingNPC( Script_MovingNPC movingNPC, List <Script_StaticNPC> NPCs, List <Script_MovingNPC> movingNPCs, bool isInitialize ) { NPCs.Add(movingNPC); movingNPCs.Add(movingNPC); movingNPC.StaticNPCId = NPCs.Count - 1; movingNPC.MovingNPCId = movingNPCs.Count - 1; if (Debug.isDebugBuild && Const_Dev.IsDevMode) { Debug.Log("NPCs Count: " + NPCs.Count + ", MovingNPCs Count: " + movingNPCs.Count); } if (isInitialize) { movingNPC.Setup(); } }
void Awake() { npc = GetComponent <Script_MovingNPC>(); activeStickerManager = Script_ActiveStickerManager.Control; }