updat core

This commit is contained in:
2024-10-23 14:56:16 +08:00
parent 61972881b6
commit 4fc0810107
28 changed files with 990 additions and 68 deletions

View File

@@ -15,7 +15,12 @@ namespace Game.Component.SceneProp
private TimeHandler _timeHandler;
protected bool isReady => this._timeHandler == null || this._timeHandler.IsDone;
public void ResetProp ()
{
this.gameObject.SetActive (true);
RefreshInvalidTime ();
}
protected virtual void OnTriggerEnter2D (Collider2D other)
{
if (other.gameObject.CompareTag ("Player"))

View File

@@ -117,6 +117,23 @@ namespace Game.Component.SceneProp.Editor
Selection.activeTransform = prop.transform;
}
[MenuItem("GameObject/场景道具/创建通关触发器" , false, 10)]
public static void CreateCompleteProp (MenuCommand menuCommand)
{
var prefab = LoadPrefab ("Assets/GameRes/AutoSource/scene_prop/completeProp.prefab");
var pos = CreatePos ();
var prop = (GameObject)PrefabUtility.InstantiatePrefab(prefab);
prop.transform.position = pos;
var target = Selection.activeTransform;
if (target != null)
{
prop.transform.SetParent (target);
}
Undo.RegisterCreatedObjectUndo(prop, "Create " + prop.name);
Selection.activeObject = prop;
Selection.activeTransform = prop.transform;
}
//创建敌人a
[MenuItem("GameObject/场景敌人/创建敌人a" , false, 10)]
public static void CreateEnemyA (MenuCommand menuCommand)

View File

@@ -0,0 +1,32 @@
using System;
using Game.EventDefine;
using UnityEngine;
namespace Game.Component.SceneProp
{
/// <summary>
/// 游戏成功触发器
/// </summary>
public class SuccessProp : BaseProp
{
protected override void OnReady ()
{
}
protected override void OnTrigger (PlayerEntity entity)
{
// GameEventDefine.GameComplete.SendMessage ();
GameEventDefine.ChangeGameFsm.SendMessage (GameState.SuccessGame);
}
#if UNITY_EDITOR
private void OnDrawGizmos ()
{
Gizmos.color = Color.yellow;
Gizmos.DrawSphere (transform.position , 0.5f);
UnityEditor.Handles.Label (transform.position, "通关点");
}
#endif
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 08b0720d3833493da90838afadab7e8a
timeCreated: 1729604454

View File

@@ -8,7 +8,6 @@ namespace Game.Component.SceneProp
[SerializeField] private float _duration = 1.5f;
protected override void OnTrigger (PlayerEntity entity)
{
Debug.Log ("wtf");
GameEventDefine.GlobalRunaway.SendMessage (this._duration);
}
}