示例#1
0
        internal string ConvertPField(ref PField field)
        {
            string result = "DataKeepField(";

            result += '"' + field.name + "\", ";

            if (field.type.Contains('"'))
            {
                result += field.type + ", [";
            }
            else
            {
                result += '"' + field.type + "\", [";
            }

            for (int i = 0; i < field.tags.Length; i++)
            {
                result += ConvertPTag(ref field.tags[i]);
                if (i != field.tags.Length - 1)
                {
                    result += ",";
                }
            }

            return(result + "])");
        }
示例#2
0
    protected override void ExtendedUpdate()
    {
        if (!IsFinished && State == GameModeState.Gameplay && IsMaster)
        {
            if (PlayersAlive <= 1)
            {
                EndGameModeSynced();
            }

            if (Time.time > _timestampDifficulty)
            {
                photonView.RPC("UpdateMeteorValues", PhotonTargets.All, _increaseMeteorCount, _diffcultyDuraction);
            }

            if (Time.time > _timestamp)
            {
                var count = Random.Range(_meteorCount.Min + Mathf.FloorToInt(_additiveMeteors), _meteorCount.Max + 1 + Mathf.FloorToInt(_additiveMeteors));

                for (int i = 0; i < count; i++)
                {
                    var pos = PField.GetRandomPosition();

                    photonView.RPC("SpawnMeteor", PhotonTargets.All, pos);
                }

                _timestamp = Time.time + _meteorInterval;
            }
        }
    }
    IEnumerator ControlPointRenewal()
    {
        if (IsMaster)
        {
            photonView.RPC("CreateControlPoint", PhotonTargets.All, PField.GetObjectiveSpawnLocation());
        }
        yield return(new WaitForSeconds(_objectiveLifetime));

        if (IsMaster)
        {
            photonView.RPC("DestroyControlPoint", PhotonTargets.All);
        }
        _cr = StartCoroutine(ControlPointRenewal());
    }
    protected override void StartGameMode()
    {
        for (int i = 0; i < Players.Count; i++)
        {
            _playerScores.Add(0f);
        }
        _endTime = Time.time + _maxGameLength;

        if (!IsMaster)
        {
            return;
        }

        photonView.RPC("SpawnItem", PhotonTargets.All, PField.GetObjectiveSpawnLocation(),
                       PhotonNetwork.AllocateViewID());
    }
示例#5
0
        private static string ParameterValueName(PropertyInfo Prop)
        {
            string PName = null;

            PField Col_1           = null; //priority 1
            Field  Col_2           = null; //priority 2
            var    CustomAttribute = Prop.GetCustomAttributes(true);

            foreach (var item in CustomAttribute)
            {
                if (item.GetType() == typeof(PField))
                {
                    Col_1 = item as PField;
                    break; //because RField is More priority
                }
                else if (item.GetType() == typeof(Field))
                {
                    Col_2 = item as Field;
                }
            }
            // rule
            if (Col_1 != null)
            {
                PName = Col_1.Name;
            }
            else if (Col_2 != null)
            {
                PName = Col_2.Name;
            }
            else
            {
                PName = Prop.Name;
            }

            return(PName);
        }