예제 #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);
 }
예제 #7
0
 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);
 }