public override void Install(EntityCore platformer) { //Check Dependency bool success = platformer.ContainsSystemCore <AnimationSys>(); GunSystem s = platformer.GetSystemCore <GunSystem>(); success &= (s != null); if (success) { //Check if the Entity Know how to use the Gun.......... success &= s.InitSystemWith <AK_Installer>(entityCore); } if (success) { //When platformer left mouse down----> the ak47.shoot. platformer.OVERRIDE_L_MOUSE_HOLD(ak47.OnTriggerHold); Debug.Log("Success"); } else { Debug.Log("Fail"); } }
public void Key_A_DOWN(EntityCore entity) { Debug.Log("Key A Down"); if (item != null) { EquipItem(item); } }
public void OnTriggerHold(EntityCore other) { //Debug.LogFormat ("The {0} is shooting the Gun AK_47", other.name); GameObject bullet = GameObject.CreatePrimitive(PrimitiveType.Sphere); bullet.transform.rotation = muzz.transform.rotation; bullet.transform.position = muzz.transform.position; Rigidbody rg = bullet.AddComponent <Rigidbody> (); rg.AddForce(bullet.transform.forward * 10000); }
public override void OnInspectorGUI() { EntityCore entityCore = (EntityCore)target; base.OnInspectorGUI(); if (GUILayout.Button("Editor Time Checking")) { entityCore.EditorTime_Invalid_Checking(); } }
public void OVERRIDE_SYSTEM_INPUT(EntityCore entity) { Debug.Log("Bind Key"); Key_A_Hold = null; Key_A_Hold = entity.Invoke_Key_A_Hold; Key_A_Down = null; Key_A_Down = entity.Invoke_Key_A_Down; Key_A_Up = null; Key_A_Up = entity.Invoke_Key_A_Up; Left_Mouse_Hold = null; Left_Mouse_Hold = entity.Invoke_L_Mouse_Hold; Left_Mouse_Down = null; Left_Mouse_Down = entity.Invoke_L_Mouse_Down; Left_Mouse_Up = null; Left_Mouse_Up = entity.Invoke_L_Mouse_Up; }
public bool InitSystemWith <T>(EntityCore other) where T : RTDependencyInstaller { for (int i = 0; i < gunDependencyInfos.Count; i++) { if (gunDependencyInfos [i].typeString == typeof(T).ToString()) { other.transform.SetParent(transform); other.transform.localPosition = gunDependencyInfos [i].transformOffset; other.transform.localRotation = gunDependencyInfos [i].rotationOffset; return(true); } } Debug.LogErrorFormat("The Current GunSystem Don't know How to Install {0}", typeof(T)); return(false); }
public abstract void Install(EntityCore e);
public void EquipItem(EntityCore item) { //Before we need to use the item, We need to Install Driver on the Entity...... item.Install_Entity_To_Target(entityCore); }
void InitalTarget() { targetLEObject = FindObjectOfType <TargetLE>().gameObject; leUnitProcessor = targetLEObject.GetComponent <EntityCore>(); }
//this function will be call at editor time by default public void ET_Sys_Init_Default(EntityCore _entity) { entityCore = _entity; entityCore.AddSystemCore(this); }
public void Install_Entity_To_Target(EntityCore e) { runtimeInstaller.Install(e); }