예제 #1
0
 public TestConnection(LineRenderer _line, bool _isPath, Color _defaultColor, Color _pathColor)
 {
     isPath       = new EventVariable <bool>(_isPath);
     isPath      += OnIsPathChanged;
     line         = _line;
     pathColor    = _pathColor;
     defaultColor = _defaultColor;
 }
예제 #2
0
 public EventAccessorDefinition(MemberFlags flags, string name, AstNode children, TokenPosition position)
     : base(children, position)
 {
     SetName(name);
     this.flags         = flags;
     this.eventVariable = null;
     this.function      = null;
     this.selfLocal     = null;
     this.valueLocal    = null;
 }
예제 #3
0
 public EventDefinition(MemberFlags flags, Expression eventType,
                        string name, AstNode accessors, TokenPosition position)
     : base(position)
 {
     SetName(name);
     this.flags         = flags;
     this.eventType     = eventType;
     this.eventVariable = null;
     this.accessors     = accessors;
     this.delegateType  = null;
 }
예제 #4
0
        internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header)
        {
            // Create the temporal event and register it.
            EventVariable ev = new EventVariable(module);

            module.RegisterMember(ev);

            // Read the name and flags.
            ev.SetName(module.GetString(header.memberName));
            ev.flags = (MemberFlags)header.memberFlags;

            // Skip the structure elements.
            reader.Skip(header.memberSize);
        }
예제 #5
0
    /* 이벤트 관련 변수 Save 파일 만들기 */
    public void SaveEventVariables(EventVariable playerEventVariable)
    {
        string saveDataPath = Application.streamingAssetsPath + "/Data/PlayerEventVariable.json";
        // EventVariable 클래스 통째로 json화
        JsonData tempJsonData = JsonMapper.ToJson(playerEventVariable);

        if (GameManager.instance.isEncrypted)
        {
            string tempStringData = GameManager.instance.EncryptData(tempJsonData.ToString());
            File.WriteAllText(saveDataPath, tempStringData);
        }
        else
        {
            File.WriteAllText(saveDataPath, tempJsonData.ToString(), System.Text.Encoding.UTF8);
        }
    }
예제 #6
0
    public bool skipText;   // 대화 출력을 스킵할 때 사용


    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        /* for the character code test */
        er         = "1000";
        garbageBag = "1001";
        npcParser  = new NpcParser();

        //ClueList = new List<Clue>();
        ClueLists = new List <Clue> [5];  //Act5까지의 단서들 리스트

        playerClueLists = new List <ClueStructure>();
        playerClueLists_In_Certain_Timeslot = new List <ClueStructure>();

        //ClueLists 초기화
        for (int i = 0; i < ClueLists.Length; i++)
        {
            ClueLists[i] = new List <Clue>();
        }

        //NumOfAct = "54";   //사건4 시작
        //TimeSlot = "75";   //첫날 시작

        checkNumOfAct = NumOfAct;
        checkTimeSlot = TimeSlot;

        //currentPosition = "Downtown_Street1";
        currentPosition = "Chapter_Merte_Office"; // 메르테 위치 : 11419, 5169
        //currentPosition = "Chapter_Zaral_Office";
        //currentPosition = "Slum_Information_agency"; // -3212 -224

        isInPortalZone = false;

        playedEventList = new List <string>();
        eventVariable   = GameManager.instance.GetEventVariable();

        // 추후에, 상호작용 될 수 있는 오브젝트의 근처에 있을 때만 상호작용 되도록 할 것(1월 27일 메모)
        SetIsNearObject(true);

        skipText = false;
    }
예제 #7
0
    private string backupCurrentPositionOfMerteInChapterForEvent317; // 317 이벤트 진행시, 카메라 위치 값 변경을 위한 변수

    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        eventIndexList      = new List <string>();
        hasBeenInHarbor     = false;
        hasPlayed252Event   = false;
        isActivatedEvent222 = false;
        eventVariable       = GameManager.instance.GetEventVariable();

        /* for test */
        // 이벤트 시스템 구현으로 인한 주석처리(테스트용, 1월 23일)
        //AddToEventIndexList("202");    //발루아 등장 이벤트 index 추가

        // 항구의 쉐렌, 악당 1, 악당 2를 비활성화 시키고, 주택가의 쉐렌을 활성화 시키기 위한 이벤트 저장
        AddToEventIndexList("0209");

        // 사건3 이벤트 등록
        // 사건3 강제 이벤트 번호 259 ~ 263
        // id 200번 이벤트부터 263번 이벤트까지 저장
        for (int i = 200; i <= 263; i++)
        {
            AddToEventIndexList(i.ToString());
        }

        // 사건4 이벤트 등록
        // 사건4 강제 이벤트 번호 316 ~ 319
        // id 300번 이벤트부터 319번 이벤트까지 저장
        for (int i = 300; i <= 319; i++)
        {
            AddToEventIndexList(i.ToString());
        }

        DisableNpcForEvent();
    }
예제 #8
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        gameState     = GameState.Idle;
        playState     = PlayState.Title;
        endingState   = EndingState.None;
        eventVariable = new EventVariable();
        dataAES       = new DataEncryption();

        activateMouseCursorTexture = Resources.Load <Texture2D>("Image/Cursor/Active");

        isEncrypted = true;
    }
예제 #9
0
 public void SetEvent(EventVariable eventVariable)
 {
     this.eventVariable = eventVariable;
 }
예제 #10
0
    void Start()
    {
        if (GameManager.instance.GetPlayState() == GameManager.PlayState.Ending)
        {
            if (GameManager.instance.GetEndingState() == GameManager.EndingState.True)
            {
                // 제렐을 플레이어로 만들고, 메르테 비활성화
                Vector3 mertePosition = GetPlayerPosition();
                merte.SetActive(false);
                andren.SetActive(true);
                SetPlayer(andren);
                SetPlayerPosition(mertePosition); // 제렐을 메르테의 원래 자리로 변경
            }
        }

        if (GameManager.instance.GetGameState().Equals(GameManager.GameState.NewGame_Loaded))
        {
            NumOfAct = "53";   //사건3 시작
            TimeSlot = "71";   //첫째주 시작

            if (GameManager.instance.GetPlayState() == GameManager.PlayState.Tutorial)
            {
                UIManager.instance.act3Button.SetActive(false);
            }
            UIManager.instance.act4Button.SetActive(false);
            UIManager.instance.act5Button.SetActive(false);

            checkNumOfAct = NumOfAct;
            checkTimeSlot = TimeSlot;

            //DialogManager.instance.SetLists();
            ItemDatabase.instance.SetLists();
        }
        else if (GameManager.instance.GetGameState().Equals(GameManager.GameState.PastGame_Loaded))
        {
            NumOfAct = "";
            TimeSlot = "";

            //DialogManager.instance.SetLists();
            ItemDatabase.instance.SetLists();
            GameManager.instance.LoadPlayerData();
            eventVariable = GameManager.instance.GetEventVariable();
            //GameManager.instance.SetEventVariable(ref GetEventVariableClass());

            if (NumOfAct.Equals("53"))
            {
                UIManager.instance.act4Button.SetActive(false);
                UIManager.instance.act5Button.SetActive(false);
            }
            else if (NumOfAct.Equals("54"))
            {
                UIManager.instance.SetNameOfCase("사건4 연쇄살인 4번째 피해자_륑 에고이스모");
                UIManager.instance.act4Button.SetActive(true);
                UIManager.instance.act5Button.SetActive(false);
            }
            else if (NumOfAct.Equals("55"))
            {
                UIManager.instance.SetNameOfCase("사건4 연쇄살인 4번째 피해자_륑 에고이스모");
                UIManager.instance.act4Button.SetActive(true);
                UIManager.instance.act5Button.SetActive(true);
            }

            checkNumOfAct = NumOfAct;
            checkTimeSlot = TimeSlot;

            ResetClueList_In_Certain_Timeslot(); // for PlaySaveGame

            EventManager.instance.PlayEvent();
        }
    }
예제 #11
0
        internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header)
        {
            // Create the temporal event and register it.
            EventVariable ev = new EventVariable(module);
            module.RegisterMember(ev);

            // Read the name and flags.
            ev.SetName(module.GetString(header.memberName));
            ev.flags = (MemberFlags)header.memberFlags;

            // Skip the structure elements.
            reader.Skip(header.memberSize);
        }
예제 #12
0
        /// <summary>
        /// <para>Get a list of the field values, as strings, associated with the specified <c>eventVariable</c> parameter.</para>
        /// <para>The values and the order in which they are serialized are defined by the <c>fieldInformationList</c> parameter.</para>
        /// </summary>
        /// <returns>A list of the field values, as strings, associated with the specified <c>eventVariable</c> parameter.</returns>
        private List <string> GetFieldValuesEventVariable(EventVariable eventVariable, List <FieldInformation_t> fieldInformationList)
        {
            // A list of the property values associated with the specified event variable.
            List <string> valueList = new List <string>();

            // The value of a field as a string.
            string valueAsString = string.Empty;

            // The raw value returned from the call to GetValue().
            object raw = null;

            // Process each Field that is specified by the 'fieldInformationList' parameter.
            FieldInformation_t fieldInformation;

            for (int index = 0; index < fieldInformationList.Count; index++)
            {
                fieldInformation = fieldInformationList[index];
                try
                {
                    // If the 'PropertyInformation' value for the field is null, generate the field value depending upon the field name.
                    if (fieldInformation.PropertyInformation == null)
                    {
                        switch (fieldInformation.CSVFieldName)
                        {
                        case FieldNameValueFromTarget:
                            // Add the event variable value to the list. Scalars are output in engineering units, enumerators are output as the text string
                            // corresponding to the enumerator value and bitmask variables are displayed in the hexadecimal value of the bitmask.
                            switch (eventVariable.VariableType)
                            {
                            case VariableType.Bitmask:
                                uint valueUINT = (uint)eventVariable.ValueFromTarget;
                                valueAsString = CommonConstants.HexValueIdentifier + valueUINT.ToString(CommonConstants.FormatStringHex);
                                break;

                            case VariableType.Enumerator:
                                valueUINT = (uint)eventVariable.ValueFromTarget;
                                try
                                {
                                    valueAsString = Lookup.EventVariableTable.GetEnumeratorText(eventVariable.Identifier, valueUINT);
                                }
                                catch (Exception)
                                {
                                    valueAsString = InvalidValueAsString;
                                }
                                break;

                            case VariableType.Scalar:
                                double engineeringValue = 0;
                                double scaleFactor      = 0;;
                                int    decimalPlaces    = 0;
                                string formatString     = String.Empty;
                                try
                                {
                                    scaleFactor = Lookup.EventVariableTable.Items[eventVariable.Identifier].ScaleFactor;
                                    General.GetDecimalPlaces(scaleFactor, out decimalPlaces);
                                    engineeringValue = eventVariable.ValueFromTarget * scaleFactor;
                                    engineeringValue = Math.Round(engineeringValue, decimalPlaces);
                                    formatString     = Lookup.EventVariableTable.Items[eventVariable.Identifier].FormatString.ToLower();
                                    if (formatString == FormatStringFieldGeneralNumber)
                                    {
                                        valueAsString = engineeringValue.ToString(FormatStringNumeric);
                                    }
                                    else if (formatString == CommonConstants.DDFormatStringHex)
                                    {
                                        valueAsString = CommonConstants.HexValueIdentifier + ((long)engineeringValue).ToString(CommonConstants.FormatStringHex);
                                    }
                                    else
                                    {
                                        valueAsString = engineeringValue.ToString();
                                    }
                                }
                                catch (Exception)
                                {
                                    valueAsString = InvalidValueAsString;
                                }
                                break;

                            default:
                                valueAsString = InvalidValueAsString;
                                break;
                            }
                            break;

                        case FieldNameCSVRecordType:
                            valueAsString = CSVRecordTypeEventVariable;
                            break;

                        default:
                            valueAsString = string.Empty;
                            break;
                        }
                    }
                    else
                    {
                        // Get the field value using the 'PropertyInformation' reference.
                        raw           = fieldInformation.PropertyInformation.GetValue(eventVariable, null);
                        valueAsString = ConvertRawPropertyValueToString(raw, ref fieldInformation);
                    }
                }
                catch (Exception)
                {
                    raw = null;
                }

                valueList.Add((UseTextQualifier) ? string.Format("\"{0}\"", valueAsString) : valueAsString);
            }
            return(valueList);
        }