示例#1
0
        public async void Testtabris1()
        {
            RequireManager requireManager = new RequireManager();

            ManagerPool.InitializeCurrentPool(new ManagerSettings());
            JavaScript.Manager.Tabris.Tabris.Register(requireManager, new JavaScript.Manager.Tabris.TabrisOptions
            {
            });
            using (var scope = new ManagerScope(requireManager))
            {
                var code = @"var tabris;
(function (){
  tabris = tabris || require('javascript_tabris'); 
try{
var lib = require('../TestDll.dll');
var myClrObject = new lib.TestDll.MyClass('tttt');
myClrObject.SayHello(); 
}catch(err){
host.err=err.message;
host.ex=err;
}
})();";
                await scope.RuntimeManager.ExecuteAsync("btnExcutor_Click", code);
            }


            //RequireManager.ClearPackages();
        }
 public override void SetUp(ActorBase _actor)
 {
     parentBulletTransform = GameObject.Find("BulletObject").transform;
     actor     = _actor;
     pool      = ToolBox.Get <ManagerPool>();
     dataShoot = actor.GetData <DataShoot>();
 }
    public override void OnInspectorGUI()
    {
        if (GUILayout.Button(" Set Serialized Pools"))
        {
            ManagerPool managerPool = (ManagerPool)target;
            foreach (var itemPool in managerPool.allPools)
            {
                if (itemPool.parentPool != null)
                {
                    itemPool.ClearCachedEditor();
                    UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(itemPool.parentPool);
                    var allObjectsForPools = itemPool.parentPool.GetComponentsInChildren <IPoolableClass>(true);
                    foreach (var itemPoolable in allObjectsForPools)
                    {
                        if (itemPool.MyPullType == itemPoolable.myPoolId)
                        {
                            itemPool.Despawn(itemPoolable);
                        }
                    }
                    UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(itemPool.parentPool);
                }
                else
                {
                    UnityEngine.Debug.LogWarning(" Tranform Parent is null for  Pool : " + itemPool.MyPullType);
                }
            }
            UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(managerPool);
            UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene());
        }

        DrawPropertiesExcluding(serializedObject, new string[] { "m_Script" });

        serializedObject.ApplyModifiedProperties();
    }
示例#4
0
    private void Awake()
    {
        if (m_TextLife == null)
        {
            throw new ObjectNullException(typeof(UIManager), nameof(m_TextLife));
        }

        if (m_TextScore == null)
        {
            throw new ObjectNullException(typeof(UIManager), nameof(m_TextScore));
        }


        if (m_TextHelp == null)
        {
            throw new ObjectNullException(typeof(UIManager), nameof(m_TextHelp));
        }

        if (m_TextPlayerUltimate == null)
        {
            throw new ObjectNullException(typeof(UIManager), nameof(m_TextPlayerUltimate));
        }


        m_PlayerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();

        UpdateScore();
        UpdateLife();
        UpdatePlayerUltimate();
    }
示例#5
0
    private void VaribleInitialize()
    {
        /*---------------------------------------------------------------------------------------*/ //Spawn Holder

        foreach (var form in m_EdgeSpawnPointsHolder)
        {
            m_EdgeSpawnPoints.Add(form as Transform);
        }

        foreach (var form in m_LeftSpawnPointsHolder)
        {
            m_LeftSpawnPoints.Add(form as Transform);
        }

        foreach (var form in m_RightSpawnPointsHolder)
        {
            m_RightSpawnPoints.Add(form as Transform);
        }

        foreach (var form in m_BottomSpawnPointsHolder)
        {
            m_BottomSpawnPoints.Add(form as Transform);
        }

        foreach (var form in m_TopSpawnPointsHolder)
        {
            m_TopSpawnPoints.Add(form as Transform);
        }

        /*---------------------------------------------------------------------------------------*/ //Target Holder

        foreach (var form in m_EdgeTargetPointsHolder)
        {
            m_EdgeTargetPoints.Add(form as Transform);
        }

        foreach (var form in m_LeftTargetPointsHolder)
        {
            m_LeftTargetPoints.Add(form as Transform);
        }

        foreach (var form in m_RightTargetPointsHolder)
        {
            m_RightTargetPoints.Add(form as Transform);
        }

        foreach (var form in m_BottomTargetPointsHolder)
        {
            m_BottomTargetPoints.Add(form as Transform);
        }

        foreach (var form in m_TopTargetPointsHolder)
        {
            m_TopTargetPoints.Add(form as Transform);
        }


        m_StageManager = ManagerPool.GetInstance().GetManager <StageManager>();
    }
示例#6
0
 public void onDispose()
 {
     managerPool         = null;
     EnemySpawnPosition  = null;
     PlayerSpawnPosition = null;
     managerCorountine   = null;
     enemyInWave.Clear();
 }
    void Awake()
    {
        VariableInit();
        EquipDefaultWeapon();

        m_UIManager = ManagerPool.GetInstance().GetManager <UIManager>();
        m_PlayerSupporterManager = ManagerPool.GetInstance().GetManager <PlayerSupporterManager>();
    }
 public override void SetUp(ActorBase _actor)
 {
     ParentBulletTransform  = GameObject.Find("BulletObject").transform;
     dataShoot              = _actor.GetData <DataShoot>();
     actorTransform         = _actor.transform;
     managerPool            = ToolBox.Get <ManagerPool>();
     _actor.gameObject.name = actorTransform.gameObject.GetInstanceID().ToString();
 }
示例#9
0
 protected virtual void Awake()
 {
     this.m_IsPlaying       = false;
     this.m_IsLoop          = false;
     this.m_RoutineList     = new List <IEnumerator>();
     this.m_PlayerManager   = ManagerPool.GetInstance().GetManager <PlayerManager>();
     this.m_ParticleManager = ManagerPool.GetInstance().GetManager <ParticleManager>();
 }
示例#10
0
 private void Start()
 {
     _pool        = Toolbox.Get <ManagerPool>();
     _audioSource = GetComponent <AudioSource>();
     _pool.AddPool(PoolType.Entities).PopulateWith(_coin, 15);
     _animator        = GetComponent <Animator>();
     _textDissolution = new ColorDissolution <TextMeshProUGUI>(_count);
 }
示例#11
0
 void Awake()
 {
     Manager.IsGameStarted = true;
     Screen.SetResolution(480, 800, false);
     ManagerPool.GetInstance();
     RoundEventInvoker.Init();
     DOTween.Init(null, true);
 }
示例#12
0
 private void Start()
 {
     m_ObjectManager = ManagerPool.GetInstance().GetManager <ObjectManager>();
     ObjectInjectionCheck();
     VariableInit();
     RoundInit();
     GameStart();
     StartCoroutine(RoundChecker());
 }
示例#13
0
    public static ManagerPool GetInstance()
    {
        if (m_Instance == null)
        {
            m_Instance = new ManagerPool();
            m_Instance.init();
        }

        return(m_Instance);
    }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ManagerPool.InitializeCurrentPool(new ManagerSettings());
        }
示例#15
0
 public AttackAction(MonoBehaviour monoBehaviour, Transform fireTransform, Vector3 defaultDirection, int bulletDamage, float bulletSpeed, EntityBulletType EntityBulletType, AllyFlag allyFlag)
 {
     this.m_MonoBehaviour    = monoBehaviour;
     this.m_Waitor           = new EventWaitor(monoBehaviour);
     this.m_FireTransform    = fireTransform;
     this.m_BulletManager    = ManagerPool.GetInstance().GetManager <BulletManager>();
     this.m_BulletDamage     = bulletDamage;
     this.m_BulletSpeed      = bulletSpeed;
     this.m_EntityBulletType = EntityBulletType;
     this.m_DefaultDirection = defaultDirection;
     this.m_AllyFlag         = allyFlag;
 }
示例#16
0
    public void OnAwake()
    {
        EnemySpawnPosition  = GameObject.FindGameObjectWithTag("SpawnEnemy");
        PlayerSpawnPosition = GameObject.FindGameObjectWithTag("SpawnPlayer");

        managerPool = ToolBox.Get <ManagerPool>();
        ToolBox.Get <ManagerEvent>().Subscribe(this);

        LaserWall         = GameObject.Instantiate(LaserWall.gameObject).transform;
        managerCorountine = ToolBox.Get <ManagerCorountine>().CoroutineComponent;
        StartGame();
    }
示例#17
0
    void Start()
    {
        levelController  = LevelController.instance;
        playerController = PlayerController.instance;
        enemyController  = EnemyController.instance;
        managerPool      = ManagerPool.instance;

        KilledEnemies = 0;

        enemylist = ManagerPool.instance.enemylist;

        StartCoroutine(EnemySpawner(spawnRate));
    }
示例#18
0
 public static void Initialize()
 {
     if (!_isInitialized)
     {
         lock (_syncLock)
         {
             if (!_isInitialized)
             {
                 //ManagerSettings should contain the maximum pool count
                 ManagerPool.InitializeCurrentPool(new ManagerSettings());
                 _isInitialized = true;
             }
         }
     }
 }
示例#19
0
        public void Script_Engine_Is_Retrieved()
        {
            ManagerPool.InitializeCurrentPool(new ManualManagerSettings {
                RuntimeMaxCount = 2
            });

            using (var scope = new ManagerScope())
            {
                var engine = scope.RuntimeManager.GetEngine();

                engine.ShouldNotBeNull();

                engine.Execute("var i = 200;");

                Assert.AreEqual(200, engine.Script.i);
            }
        }
示例#20
0
    private void VariableInit()
    {
        m_PlayerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();

        //쿨탐 초기화
        m_PlayerGun = m_PlayerManager.GetPlayerGun();
        m_PlayerGun.SetCurrentBulletFiringTime(0.0f);


        GunCoreCharging charging = m_PlayerGun.GetCore <GunCoreCharging>();

        if (charging != null)
        {
            charging.SetIsChargingFull(false);
            charging.SetIsChargingFiring(false);
            charging.SetIsCharging(false);
            charging.SetChargingTime(0.0f);
        }
    }
        public async void Script_Exceeding_Pool_Count_Blocks_Until_Item_Available()
        {
            //Set the manager max count
            ManagerPool.InitializeCurrentPool(new ManualManagerSettings {
                RuntimeMaxCount = 2
            });

            const string script = "Console.WriteLine('Started {0}:' + new Date().toJSON()); " +
                                  "var now = new Date().getTime(); while(new Date().getTime() < now + 1000){{ /* do nothing */ }}; " +
                                  "Console.WriteLine('finished {0}:' + new Date().toJSON());";

            var startDate = DateTime.UtcNow;

            await Task.WhenAll(
                RunInScope("first", script),
                RunInScope("second", script),
                RunInScope("third", script));

            DateTime.UtcNow.Subtract(startDate).ShouldBeGreaterThan(new TimeSpan(0, 0, 2));
        }
示例#22
0
    protected override void Awake()
    {
        base.Awake();
        m_PlayerSupporterType = PlayerSupporterType.Default;
        m_PlayerManager       = ManagerPool.GetInstance().GetManager <PlayerManager>();
        m_Tween = gameObject.transform.DOMove(new Vector3(), 0.2f).SetAutoKill(false);
        m_Tween.Pause();
        m_LastPosition = new Vector3();

        if (m_FireTransforms.Length == 0)
        {
            throw new ObjectNullException(typeof(PlayerSupporterCore), nameof(m_FireTransforms));
        }

        EventCore()
        .Wait(1.0f)
        .AppendAttackCornShot(m_FireTransforms[0], 10, 200.0f, EntityBulletType.SmallBean, 0.0f, 1, AllyFlag.Player, Vector3.up)
        .Loop(true)
        .Run();
    }
        public async void Testtabris()
        {
            RequireManager requireManager = new RequireManager();

            Tabris.Register(requireManager);
            ManagerPool.InitializeCurrentPool(new ManagerSettings());
            using (var scope = new ManagerScope(requireManager))
            {
                var code = "var log = this.tabris.create('LOG');" +
                           "try{ aa.ttt =1}catch(err){log.info(err)}";
                code = "var tabris;" + "(function (){\n  tabris = tabris || require('javascript_tabris'); \n" + code + "\n})();";
                await scope.RuntimeManager.ExecuteAsync("btnExcutor_Click", code);

                code = "var log = this.tabris.create('LOG');" +
                       "try{ aa.ttt =1}catch(err){log.info(err)}";
                code = "var tabris;" + "(function (){\n  tabris = tabris || require('javascript_tabris'); \n" + code + "\n})();";
                await scope.RuntimeManager.ExecuteAsync("btnExcutor_Click", code);
            }


            //RequireManager.ClearPackages();
        }
示例#24
0
    public Round()
    {
        this.m_StageManager  = ManagerPool.GetInstance().GetManager <StageManager>();
        this.m_PlayerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();
        this.m_EnemyManager  = ManagerPool.GetInstance().GetManager <EnemyManager>();
        this.m_UIManager     = ManagerPool.GetInstance().GetManager <UIManager>();


        this.m_EdgeSpawnPoints   = m_EnemyManager.GetEnemySpawnPoints(Direction.Default);
        this.m_LeftSpawnPoints   = m_EnemyManager.GetEnemySpawnPoints(Direction.Left);
        this.m_RightSpawnPoints  = m_EnemyManager.GetEnemySpawnPoints(Direction.Right);
        this.m_TopSpawnPoints    = m_EnemyManager.GetEnemySpawnPoints(Direction.Top);
        this.m_BottomSpawnPoints = m_EnemyManager.GetEnemySpawnPoints(Direction.Bottom);

        this.m_EdgeTargetPoints   = m_EnemyManager.GetTargetPoints(Direction.Default);
        this.m_LeftTargetPoints   = m_EnemyManager.GetTargetPoints(Direction.Left);
        this.m_RightTargetPoints  = m_EnemyManager.GetTargetPoints(Direction.Right);
        this.m_TopTargetPoints    = m_EnemyManager.GetTargetPoints(Direction.Top);
        this.m_BottomTargetPoints = m_EnemyManager.GetTargetPoints(Direction.Bottom);

        this.m_ScreenSize     = m_StageManager.GetScreenSize();
        this.m_PathHolderList = m_StageManager.GetPathHolders();
    }
示例#25
0
 void Start()
 {
     managerPool = GameObject.Find("Manager").GetComponent <ManagerPool>();
 }
示例#26
0
 /// <summary>
 /// 메소드는 Manager.cs의 OnDestroy 함수외에선 콜 금지
 /// </summary>
 public void SafeClear()
 {
     m_ManagerList.Clear();
     m_Instance = null;
 }
 public void TestSetUp()
 {
     ManagerPool.InitializeCurrentPool(new ManualManagerSettings());
 }
        public void Go()
        {
            Log.Info("Started");

            var poolLog = LogManager.GetLogger("Pool");
            var pool    = new ManagerPool(Constants.Server, Constants.Login, Constants.Password, (ctx, type, message, exception) => poolLog.Trace($"{type} {message} {exception}"))
            {
            };

            var lastOpDateTime = DateTime.MinValue;
            var rnd            = new Random();

            // very important step to run pool
            pool.Run();

            for (int i = 0; i < ThreadsCount; ++i)
            {
                _tasks[i] = new Task(a =>
                {
                    do
                    {
                        var _log = LogManager.GetLogger("Thread_" + a);
                        try
                        {
                            try
                            {
                                using (var v = pool.Get(TimeSpan.FromSeconds(5)))
                                {
                                    // randomly await from 1 to 5 minutes
                                    if (DateTime.Now - lastOpDateTime > TimeSpan.FromMinutes(rnd.Next(1, 5)))
                                    {
                                        lastOpDateTime = DateTime.Now;

                                        _log.Trace("Trying to get data");
                                        var mgr       = v.Data.Value;
                                        var allUsers  = mgr.UsersRequest();
                                        var allTrades = mgr.TradesRequest();
                                        var symbols   = mgr.SymbolsGetAll();

                                        _log.Info("Fetched {0} users", allUsers.Count);
                                        _log.Info("Fetched {0} trades", allTrades.Count);
                                        _log.Info("Fetched {0} symbols", symbols.Count);
                                    }
                                }
                            }
                            catch (TimeoutException to)
                            {
                                _log.Warn(to.Message);
                            }
                        }
                        catch (Exception ex)
                        {
                            _log.Error(ex);
                        }
                    } while (false == _eventStop.WaitOne(TimeSpan.FromSeconds(1)));
                },
                                     i);

                _tasks[i].Start();
            }

            Log.Info("All tasks started");
        }
    protected void OnTriggerEnter(Collider coll)
    {
        if (coll.tag == "EnemyBullet")
        {
            if (gameObject.layer == LayerMask.NameToLayer("EnemyEntity"))
            {
                return;
            }

            ParticleFactory.GetInstance().CreateOnceParticle <ParticleExplosion>(coll.gameObject.GetComponent <Collider>().ClosestPointOnBounds(transform.position))
            .SetExplosionParticleNumber(10)
            .SetMinExplosionDistance(1.0f)
            .SetMaxExplosionDistance(3.0f)
            .SetExplosionParticleLifeTime(0.4f)
            .SetExplosionParticleColor(new Color(Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f)))
            .Play();

            if (m_Core.isPenetrable() == false)
            {
                Destroy(coll.gameObject.transform.parent.gameObject);
            }

            Material material = GetComponentInChildren <MeshRenderer>().material;

            if (m_Core.IsInvincible() == false)
            {
                m_Core.SetHp <EntityCore>(m_Core.GetHp() - ManagerPool.GetInstance().GetManager <PlayerManager>().GetPlayerGun().GetBulletDamage());
            }

            if (m_Core.GetHp() <= 0)
            {
                PlayerManager playerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();
                playerManager.SetPlayerScore(playerManager.GetPlayerScore() + m_Core.GetScore());

                ParticleFactory.GetInstance().CreateOnceParticle <ParticleExplosion>(gameObject.transform.position)
                .SetExplosionParticleColor(new Color(Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f)))
                .Play();
                Destroy(gameObject);

                material.DOKill();
            }
            else
            {
                DOTween.Sequence()
                .Append(material.DOColor(Color.white, 0.05f))
                .Append(material.DOColor(m_Core.GetColor(), 0.05f));
            }
        }

        if (coll.tag == "PlayerBullet")
        {
            if (gameObject.layer == LayerMask.NameToLayer("PlayerEntity"))
            {
                return;
            }

            ParticleFactory.GetInstance().CreateOnceParticle <ParticleExplosion>(coll.gameObject.GetComponent <Collider>().ClosestPointOnBounds(transform.position))
            .SetExplosionParticleNumber(10)
            .SetMinExplosionDistance(1.0f)
            .SetMaxExplosionDistance(3.0f)
            .SetExplosionParticleLifeTime(0.4f)
            .SetExplosionParticleColor(new Color(Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f)))
            .Play();

            if (m_Core.isPenetrable() == false)
            {
                Destroy(coll.gameObject.transform.parent.gameObject);
            }

            Material material = GetComponentInChildren <MeshRenderer>().material;

            if (m_Core.IsInvincible() == false)
            {
                m_Core.SetHp <EntityCore>(m_Core.GetHp() - ManagerPool.GetInstance().GetManager <PlayerManager>().GetPlayerGun().GetBulletDamage());
            }

            if (m_Core.GetHp() <= 0)
            {
                PlayerManager playerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();
                ItemManager   itemManager   = ManagerPool.GetInstance().GetManager <ItemManager>();

                playerManager.SetPlayerScore(playerManager.GetPlayerScore() + m_Core.GetScore());

                ParticleFactory.GetInstance().CreateOnceParticle <ParticleExplosion>(gameObject.transform.position)
                .SetExplosionParticleColor(new Color(Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f), Random.Range(0.5f, 1.0f)))
                .Play();

                float randNum = Random.Range(0.0f, 1000.0f);
                if (randNum <= 1000.0f)
                {
                    ItemType itemType = (ItemType)Random.Range(1, Enum.GetValues(typeof(ItemType)).Cast <int>().Max() + 1);
                    itemManager.SpawnItem(itemType, gameObject.transform.position);
                }

                Destroy(gameObject);
                material.DOKill();
            }
            else
            {
                if (m_Core.IsInvincible() == false)
                {
                    DOTween.Sequence()
                    .Append(material.DOColor(Color.white, 0.05f))
                    .Append(material.DOColor(m_Core.GetColor(), 0.05f));
                }
            }
        }
    }
 private void VariableInit()
 {
     m_PlayerManager = ManagerPool.GetInstance().GetManager <PlayerManager>();
     m_StageManager  = ManagerPool.GetInstance().GetManager <StageManager>();
     m_EnemyManager  = ManagerPool.GetInstance().GetManager <EnemyManager>();
 }