示例#1
0
        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");
            }
        }
示例#2
0
 public void Key_A_DOWN(EntityCore entity)
 {
     Debug.Log("Key A Down");
     if (item != null)
     {
         EquipItem(item);
     }
 }
示例#3
0
        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);
        }
示例#4
0
        public override void OnInspectorGUI()
        {
            EntityCore entityCore = (EntityCore)target;

            base.OnInspectorGUI();

            if (GUILayout.Button("Editor Time Checking"))
            {
                entityCore.EditorTime_Invalid_Checking();
            }
        }
示例#5
0
        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;
        }
示例#6
0
 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);
示例#8
0
 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);
 }
示例#9
0
 void InitalTarget()
 {
     targetLEObject  = FindObjectOfType <TargetLE>().gameObject;
     leUnitProcessor = targetLEObject.GetComponent <EntityCore>();
 }
示例#10
0
 //this function will be call at editor time by default
 public void ET_Sys_Init_Default(EntityCore _entity)
 {
     entityCore = _entity;
     entityCore.AddSystemCore(this);
 }
示例#11
0
 public void Install_Entity_To_Target(EntityCore e)
 {
     runtimeInstaller.Install(e);
 }