Esempio n. 1
0
    private void Awake()
    {
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
        if (localController != null)
        {
            localController.CheckRespawnItemHave();
            resTime -= resTime * localController.RespwanTimeDec;
            if (resTime < 0f)
            {
                resTime = 0f;
            }
        }
        respawnTimeSecure.Init(resTime);
        NoCheat.Instance.Sync(NoCheat.WATCH_DOG.RESPAWMTIME, resTime);
    }
    private void CheckMyself(Vector3 boomPos, float DamageRadius)
    {
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            LocalController component = gameObject.GetComponent <LocalController>();
            if (null == component)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
            else
            {
                Vector3 position = gameObject.transform.position;
                if (Vector3.Distance(position, boomPos) < DamageRadius)
                {
                    component.GetHit(MyInfoManager.Instance.Seq, poisonDamage, 1f, -4, -1, autoHealPossible: true, checkZombie: false);
                }
            }
        }
    }
Esempio n. 3
0
        public void Create(Group group)
        {
            using (ApplicationDbContext context = new ApplicationDbContext())
            {
                LocalController lc = context.LocalControllers.Include("Groups").FirstOrDefault(l => l.Code == group.LCCode);

                if (lc != null)
                {
                    if (!lc.Groups.Any(g => g.Name == group.Name))
                    {
                        lc.Groups.Add(group);

                        context.SaveChanges();
                    }
                    else
                    {
                        MessageBox.Show("The group with this name already exists in local system.", "Name taken", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Can't find Local Controller.", "Local Controller error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Esempio n. 4
0
 public override void StartItem()
 {
     if (IsMyItem())
     {
         GameObject gameObject = GameObject.Find("Me");
         if (null != gameObject)
         {
             LocalController component = gameObject.GetComponent <LocalController>();
             if (component != null)
             {
                 component.EquipSmokeBomb();
             }
         }
     }
     else
     {
         GameObject gameObject2 = BrickManManager.Instance.Get(useUserSeq);
         if (gameObject2 != null)
         {
             LookCoordinator component2 = gameObject2.GetComponent <LookCoordinator>();
             if (component2 != null)
             {
                 component2.EquipSmokeBomb();
             }
         }
     }
 }
    private void Start()
    {
        localController = null;
        brickSeq        = -1;
        shooter         = -1;
        InitializeAnimation();
        audioSource = GetComponent <AudioSource>();
        BrickProperty component = base.transform.parent.GetComponent <BrickProperty>();

        if (null == component)
        {
            Debug.LogError("ERROR, Fail to get brick sequence number for cannon controller");
        }
        else
        {
            brickSeq = component.Seq;
        }
        if (null != axle)
        {
            SaveAxleAngle();
        }
        muzzleFxInstances = new GameObject[muzzles.Length];
        for (int i = 0; i < muzzles.Length; i++)
        {
            muzzleFxInstances[i] = null;
        }
    }
Esempio n. 6
0
 public override bool Update()
 {
     if (!battleChat.IsChatting && custom_inputs.Instance.GetButtonDown(editorToolScript.inputKey) && IsEnable())
     {
         active = true;
         phase  = PHASE.NONE;
         start  = new Vector3(10000f, 10000f, 10000f);
         end    = new Vector3(10000f, 10000f, 10000f);
         return(true);
     }
     if (!battleChat.IsChatting && custom_inputs.Instance.GetButtonDown(editorToolScript.inputKey) && !IsEnable())
     {
         GameObject gameObject = GameObject.Find("Me");
         if (null != gameObject)
         {
             LocalController component = gameObject.GetComponent <LocalController>();
             if (null != component)
             {
                 component.addStatusMsg(StringMgr.Instance.Get("ITEM_USED_ALL"));
             }
         }
         return(false);
     }
     return(false);
 }
Esempio n. 7
0
    private void InitializeFirstPerson()
    {
        int[] usables = new int[1]
        {
            4
        };
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(usables);
            }
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
    }
Esempio n. 8
0
    private void Start()
    {
        play       = 0;
        playDelta  = 0f;
        dummyDelta = 0f;
        remain     = RoomManager.Instance.TimeLimit;
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
        zombieMatch           = GetComponent <ZombieMatch>();
        backChange.position.x = (float)(bkgnd.width / 2) + expandArea;
        backChange.position.y = (float)(bkgnd.height / 2) + expandArea;
        backChange.texImage   = bkgnd;
        backChange.startSize  = 1f;
        backChange.AddStep(1.5f, 0.28f);
        backChange.AddStep(1f, 0.28f);
        backChange.repeat = true;
    }
    private void Start()
    {
        play      = 0;
        playDelta = 0f;
        remain    = RoomManager.Instance.TimeLimit;
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
        if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.BUNGEE || RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.ESCAPE)
        {
            offset.x = (float)((Screen.width - bkgnd.width) / 2);
        }
        backChange.position.x = (float)(bkgnd.width / 2) + expandArea;
        backChange.position.y = (float)(bkgnd.height / 2) + expandArea;
        backChange.texImage   = bkgnd;
        backChange.startSize  = 1f;
        backChange.AddStep(1.5f, 0.28f);
        backChange.AddStep(1f, 0.28f);
        backChange.repeat = true;
    }
Esempio n. 10
0
    public bool CreateExplosion(Vector3 pos)
    {
        if (MyInfoManager.Instance.IsBelow12())
        {
            Object.Instantiate((Object)explosionEffect11, pos, Quaternion.Euler(0f, 0f, 0f));
        }
        else
        {
            Object.Instantiate((Object)explosionEffect, pos, Quaternion.Euler(0f, 0f, 0f));
        }
        GameObject gameObject = GameObject.Find("Me");

        if (null != gameObject && Vector3.Distance(pos, gameObject.transform.position) < explosionRadius)
        {
            float   num      = pos.y + bombExplosionExceptHigher;
            Vector3 position = gameObject.transform.position;
            if (num > position.y)
            {
                float   num2      = pos.y - bombExplosionExceptLower;
                Vector3 position2 = gameObject.transform.position;
                if (num2 < position2.y)
                {
                    LocalController component = gameObject.GetComponent <LocalController>();
                    if (component != null && !component.IsDead)
                    {
                        component.GetHitBungeeBomb(useUserSeq, 32);
                    }
                }
            }
        }
        return(false);
    }
Esempio n. 11
0
 //-------------------------------------------------------------------
 void UpdateLocalControllers()
 {
     // Only allow players to join/leave during the lobby state
     if (GameManager.GetInstance().m_currentState == eGameState.WAIT_FOR_READY)
     {
         for (int i = 0; i < LocalControllers.Length; ++i)
         {
             LocalController local = LocalControllers[i];
             if (local == null)
             {
                 KeyCode join_key = LocalController.GetActionKey(i);
                 if (Input.GetKeyDown(join_key))
                 {
                     GameObject go = GameObject.Instantiate(LocalControllerPrefab);
                     local               = go.GetComponent <LocalController>();
                     local.GamepadID     = i;
                     LocalControllers[i] = local;
                 }
             }
             else
             {
                 // only allow people to leave locally
                 KeyCode leave_key = LocalController.GetCancelKey(i);
                 if (Input.GetKeyDown(leave_key))
                 {
                     GameObject.Destroy(local.gameObject);
                     LocalControllers[i] = null;
                 }
             }
         }
     }
 }
Esempio n. 12
0
 private void Start()
 {
     deltaTime1      = 0f;
     deltaTime2      = 0f;
     secondImgIn     = false;
     localController = GetComponent <LocalController>();
 }
        private void Query(ref BaseUnitStatus.Component status,
                           ref AdvancedUnmannedInput.Component unMannedInput,
                           ref AdvancedUnitController.Component controller,
                           ref LocalController local)
        {
            if (status.State != UnitState.Alive)
            {
                return;
            }

            var inter = unMannedInput.Interval;

            if (CheckTime(ref inter) == false)
            {
                return;
            }

            unMannedInput.Interval = inter;
            var x           = UnityEngine.Random.Range(-1.0f, 1.0f);
            var y           = UnityEngine.Random.Range(-1.0f, 1.0f);
            var isShiftDown = false; //Input.GetKey(KeyCode.LeftShift);
            var isJump      = false; //Input.GetKey(KeyCode.Space);
            var action      = local.Action;
            var stick       = local.Stick;

            if (CommonUpdate(new Vector2(x, y), new Vector2(x, y), isShiftDown, isJump, false, false, ref stick, ref action))
            {
                controller.Action = action;
            }

            local.Action = action;
            local.Stick  = stick;
        }
Esempio n. 14
0
 private void VerifyLocalController()
 {
     if (null == localController)
     {
         localController = GetComponent <LocalController>();
     }
 }
Esempio n. 15
0
        public void Details()
        {
            LocalController localController = new LocalController();

            var result = localController.Details(2) as ViewResult;

            Assert.IsNotNull(result.ViewName);
        }
Esempio n. 16
0
        public void Delete()
        {
            LocalController localController = new LocalController();

            var result = localController.Index() as ViewResult;

            Assert.IsNotNull(result.ViewName);
        }
Esempio n. 17
0
 public CadastroEventoForm(Evento evento)
 {
     this.evento         = evento;
     eventoController    = new EventoController();
     categoriaController = new CategoriaController();
     localController     = new LocalController();
     InitializeComponent();
     PrepararFormulario();
 }
        public bool IsOnline(string code)
        {
            using (ApplicationDbContext context = new ApplicationDbContext())
            {
                LocalController lc = context.LocalControllers.FirstOrDefault(l => l.Code.Equals(code));

                return(lc != null && lc.IsOnline);
            }
        }
Esempio n. 19
0
        public async Task <List <TModel> > GetListByPeriodAndArea(Period period, SalesAreaHierarchy region)
        {
            CriteriaBuilder criteriaBuilder = new CriteriaBuilder();

            return(await LocalController.GetManyByCriteria(
                       criteriaBuilder
                       .Add("Period", (int)period)
                       .Add("Region", (int)region)));
        }
Esempio n. 20
0
 private void VerifyLocalController()
 {
     me = GameObject.Find("Me");
     if (null != me)
     {
         localController = me.GetComponent <LocalController>();
         equipcoord      = me.GetComponent <EquipCoordinator>();
     }
 }
    private void InitializeFirstPerson()
    {
        int[] array = null;
        switch (RoomManager.Instance.WeaponOption)
        {
        case 2:
            array = new int[2]
            {
                0,
                4
            };
            break;

        case 1:
            array = new int[3]
            {
                0,
                1,
                4
            };
            break;

        default:
            array = new int[5]
            {
                0,
                2,
                1,
                3,
                4
            };
            break;
        }
        me = GameObject.Find("Me");
        if (null == me)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = me.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(array);
            }
            localController = me.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
    }
Esempio n. 22
0
        public ConfigGridControl(IConfigController configController, IExporter[] allExporters, LocalController localController, IBuildController buildController)
        {
            _allExporters     = allExporters;
            _localController  = localController;
            _configController = configController;
            _buildController  = buildController;

            InitializeComponent();
            InitializeGrid();
        }
    private void OnTriggerEnter(Collider other)
    {
        LocalController component = other.gameObject.GetComponent <LocalController>();

        if (component != null)
        {
            component.OnTrampoline(seq);
            BrickManager.Instance.AnimationPlay(index, seq, "fire");
        }
    }
Esempio n. 24
0
        public ConfigSectionControl(LocalController localController, ICoreConfigSection coreConfigSection, IExporter[] allExporters, IBuildController buildController)
        {
            _localController   = localController;
            _coreConfigSection = coreConfigSection;
            _allExporters      = allExporters;
            _buildController   = buildController;

            DataContext = this;
            InitializeComponent();
        }
Esempio n. 25
0
        public void ShouldGetDefaultLocalStrings()
        {
            // Arrange
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var localStrings = localController.GetLocalStringsOrDefault<TestLocalStrings>("default");

            // Assert
            Assert.AreEqual("TestString1", localStrings.TestString1);
        }
Esempio n. 26
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 27
0
        public void ShouldGetDELocalStrings()
        {
            // Arrange
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var localStrings = localController.GetLocalStringsOrDefault <TestLocalStrings>("de");

            // Assert
            Assert.AreEqual("TestString1DE", localStrings.TestString1);
        }
Esempio n. 28
0
        public void ShouldGetDefaultLocalStringsBecauseLanguageNotFound()
        {
            // Arrange
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var localStrings = localController.GetLocalStringsOrDefault <TestLocalStrings>("fr");

            // Assert
            Assert.AreEqual("TestString1", localStrings.TestString1);
        }
Esempio n. 29
0
        public void TestLocalControllerConstructors()
        {
            LocalController lc1 = new LocalController();
            LocalController lc2 = new LocalController("123");

            Assert.IsNotNull(lc1);
            Assert.IsInstanceOf <LocalController>(lc1);

            Assert.IsNotNull(lc2);
            Assert.IsInstanceOf <LocalController>(lc2);
        }
 private void VerifyLocalController()
 {
     if (null == localController)
     {
         GameObject gameObject = GameObject.Find("Me");
         if (null != gameObject)
         {
             localController = gameObject.GetComponent <LocalController>();
         }
     }
 }
Esempio n. 31
0
 private void OnTriggerEnter(Collider other)
 {
     if (!Application.loadedLevelName.Contains("MapEditor") && base.enabled)
     {
         LocalController component = other.GetComponent <LocalController>();
         if (null != component)
         {
             RunScript();
         }
     }
 }
Esempio n. 32
0
        public void ShouldGetLocalizedDEStrings()
        {
            // Arrange
            Thread.CurrentThread.CurrentCulture = new CultureInfo("de");
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var strings = localController.GetLocalStrings<TestLocalStrings>();

            // Assert
            Assert.AreEqual(strings.TestString1, "TestString1DE");
        }
Esempio n. 33
0
        public void ShouldGetLocalizedDEStringByName()
        {
            // Arrange
            Thread.CurrentThread.CurrentCulture = new CultureInfo("de");
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var strings = localController.GetLocalString(typeof(TestLocalStrings), "TestString1");

            // Assert
            Assert.AreEqual("TestString1DE", strings);
        }
Esempio n. 34
0
        public void ShouldGetTestLocalStrings()
        {
            // Arrange   
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en");
            var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() });

            // Act
            var strings = localController.GetLocalStrings<TestLocalStrings>();

            // Assert
            Assert.IsNotNull(strings);
            Assert.AreEqual("TestString1", strings.TestString1);
        }