Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        //PlayerPrefs.DeleteAll();
        if (!PlayerPrefs.HasKey("CurrentProfile"))
        {
            PlayerPrefs.SetInt("CurrentProfile", -1);
        }
        profileCamera = Camera.main.GetComponent <ProfileCamera>();
        crew          = new Profile.Avatar[3];

        profiles = new Profile[4];
        for (int i = 0; i < profiles.Length; i++)
        {
            profiles[i] = new Profile();
            profiles[i].LoadProfile(i);
//			float avatarOffset = 3;
            SetProfileBoard(i);
        }


        SkillDataBase.SetSkills();

        SetProfileBoardButtonActive(true);

        acceptButton.gameObject.SetActive(false);
    }
Esempio n. 2
0
    public ActorModule()
    {
        this.m_ActorLogicDataDic = new Dictionary <string, ActorLogicData>();
        List <ActorData> actorList      = ConfigCtrller.Instance.Actor.GetActors();
        string           actorUIDPrefix = "actor{0}";
        string           skillUIDPrefix = "skill{0}";
        int actorUIDCounter             = 1;
        int skillUIDCounter             = 1;

        foreach (var actorData in actorList)
        {
            List <SkillLogicDataBase> skillList = new List <SkillLogicDataBase>();
            foreach (var acotrSkillID in actorData.Skills)
            {
                ActorSkillData       actorSkillData    = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID);
                List <SkillDataBase> skillDataBaseList = new List <SkillDataBase>();
                foreach (var skillID in actorSkillData.SkillIDs)
                {
                    SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID);
                    skillDataBaseList.Add(skillDataBase);
                }
                SkillLogicDataBase skillLogicData = null;
                string             skillUID       = string.Format(skillUIDPrefix, skillUIDCounter);
                switch (actorSkillData.SkillType)
                {
                case SkillType.Normal:
                    break;

                case SkillType.First:
                case SkillType.Active:
                    skillLogicData = new ActiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList);
                    break;

                case SkillType.Passive:
                    skillLogicData = new PassiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList);
                    break;

                case SkillType.Trigger:
                    skillLogicData = new TriggerSkillLogicData(skillUID, actorSkillData, skillDataBaseList);
                    break;

                case SkillType.Weather:
                    skillLogicData = new WeatherSkillLogicData(skillUID, actorSkillData, skillDataBaseList);
                    break;

                default:
                    break;
                }
                skillUIDCounter++;
                if (skillLogicData != null)
                {
                    skillList.Add(skillLogicData);
                }
            }
            string         actorUID       = string.Format(actorUIDPrefix, actorUIDCounter++);
            ActorLogicData actorLogicData = new ActorLogicData(actorUID, actorData, skillList);
            this.m_ActorLogicDataDic.Add(actorUID, actorLogicData);
        }
        this.InitBattleArray();
    }
Esempio n. 3
0
 void Awake()
 {
     if (ProfileManager.currentProfile == null && PlayerPrefs.GetInt("CurrentProfile") != -1)
     {
         ProfileManager.currentProfile = new Profile();
         ProfileManager.currentProfile.LoadProfile(PlayerPrefs.GetInt("CurrentProfile"));
         SkillDataBase.SetSkills();
     }
 }
Esempio n. 4
0
 protected override void Start()
 {
     base.Start();
     skillDB            = GameObject.FindGameObjectWithTag("SkillDataBase").GetComponent <SkillDataBase>();
     errorMessageWindow = GameObject.Find("ErrorMessage").GetComponent <ErrorMessageWindow>();
     errorMessageWindow.InitErrorMessageWindow();
     nullColor = new Vector4(1, 1, 1, 0.4f);
     InitSelectSquare();
     InitSkillListPanel();
     InitSkillSetPanel();
 }
Esempio n. 5
0
 private void ParseSkillDataBase(DataRow row, SkillDataBase data)
 {
     data.ID               = int.Parse(row["ID"].ToString());
     data.Name             = row["Name"].ToString();
     data.Description      = row["Description"].ToString();
     data.Icon             = row["Icon"].ToString();
     data.EffectTarget     = row.IsNull("EffectTarget") ? (ActorType?)null : (ActorType)Enum.Parse(typeof(ActorType), row["EffectTarget"].ToString());
     data.ChangeAttribute  = row.IsNull("ChangeAttribute") ? (AttributeType?)null : (AttributeType)Enum.Parse(typeof(AttributeType), row["ChangeAttribute"].ToString());
     data.ChangeRateOrVale = row.IsNull("ChangeRateOrVale") ? (RateOrValueType?)null : (RateOrValueType)Enum.Parse(typeof(RateOrValueType), row["ChangeRateOrVale"].ToString());
     data.ChangeValue      = row.IsNull("ChangeValue") ? (float?)null : float.Parse(row["ChangeValue"].ToString());
     data.ShieldType       = row.IsNull("ShieldType") ? (ShieldType?)null : (ShieldType)Enum.Parse(typeof(ActorType), row["ShieldType"].ToString());
 }
Esempio n. 6
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="data"></param>
    public void InitEnemy(int id, GridData gridData)
    {
        ActorData actorData = ConfigCtrller.Instance.Actor.GetActorDataByID(id);
        List <SkillLogicDataBase> skillList = new List <SkillLogicDataBase>();

        foreach (var acotrSkillID in actorData.Skills)
        {
            ActorSkillData       actorSkillData    = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID);
            List <SkillDataBase> skillDataBaseList = new List <SkillDataBase>();
            foreach (var skillID in actorSkillData.SkillIDs)
            {
                SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID);
                skillDataBaseList.Add(skillDataBase);
            }
            SkillLogicDataBase skillLogicData = null;
            switch (actorSkillData.SkillType)
            {
            case SkillType.Normal:
                break;

            case SkillType.First:
            case SkillType.Active:
                skillLogicData = new ActiveSkillLogicData(actorSkillData, skillDataBaseList);
                break;

            case SkillType.Passive:
                skillLogicData = new PassiveSkillLogicData(actorSkillData, skillDataBaseList);
                break;

            case SkillType.Trigger:
                skillLogicData = new TriggerSkillLogicData(actorSkillData, skillDataBaseList);
                break;

            case SkillType.Weather:
                skillLogicData = new WeatherSkillLogicData(actorSkillData, skillDataBaseList);
                break;

            default:
                break;
            }
            if (skillLogicData != null)
            {
                skillList.Add(skillLogicData);
            }
        }
        ActorLogicData actorLogicData = new ActorLogicData(actorData, skillList);

        this.Init(actorLogicData);
    }
Esempio n. 7
0
 public bool Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         skill = SkillDataBase.GetSkill(SkillType.Fire);
     }
     if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         skill = SkillDataBase.GetSkill(SkillType.Figa);
     }
     if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         skill = SkillDataBase.GetSkill(SkillType.Kearu);
     }
     return(skill.Update(unit));
 }
Esempio n. 8
0
    void OnPointerDragBegin(PointerEventData data)
    {
        if (m_data.GetData().m_Active)
        {
            m_SkillObject = GameObject.Instantiate(m_data) as SkillDataBase;
            m_SkillObject.transform.SetParent(GameObject.Find("SkillUI").transform, false);

            m_SkillObject.gameObject.tag = "Skill_Temp";
            m_SkillObject.GetComponent <Image>().raycastTarget = false;
            m_SkillObject.GetComponent <Image>().color         = new Color(0.5f, 0.5f, 0.5f);
            if (m_SkillObject.transform.childCount >= 2)
            {
                m_SkillObject.transform.GetChild(1).gameObject.SetActive(false);
            }
        }
    }
Esempio n. 9
0
    protected override void InitManager()
    {
        base.InitManager();
        //Awake에서 실행되던 것들
        SkillPanelList  = new DragAndDropItem[4];
        SkillPanelQueue = new Queue <DragAndDropItem>();
        preSetList      = new List <int>();

        //Start에서 실행되던 것들
        //스킬 관련 초기화.
        SkillDB = GameObject.FindGameObjectWithTag("SkillDataBase").GetComponent <SkillDataBase>();
        string[] tempList = PlayManage.Instance.SkillPreSet.Split(',');
        EnrollSkillPanelList();
        for (int i = 0; i < tempList.Length; i++)
        {
            preSetList.Add(int.Parse(tempList[i]));
        }
        StartCoroutine(InitSkillPanel());
        SkillPanelQueue = new Queue <DragAndDropItem>();
    }
Esempio n. 10
0
    public bool CheckEquationAnswer(int index, int guess)
    {
        if (index != currentEquationIndex)
        {
            return(false);
        }

        if (guess == currentEquation.answer)
        {
            Skill skill = SkillDataBase.GetSkill(currentEquation.type, currentEquation.answer);
            skill.AddProgress(ProfileManager.currentProfileIndex, .1f);
            currentEquation.status = Equation.Status.Correct;

            return(true);
        }
        else
        {
            Debug.Log("Wrong Answer");
            currentEquation.status = Equation.Status.Incorrect;
            //NextEquation ();
            return(false);
        }
    }
Esempio n. 11
0
 // Start is called before the first frame update
 void Start()
 {
     EventTrigger_Init();
     m_data    = GetComponent <SkillDataBase>();
     m_dragend = false;
 }
Esempio n. 12
0
 // Start is called before the first frame update
 void Awake()
 {
     m_Skill   = GetComponentInChildren <SkillDataBase>();
     content_x = 0f;
     content_y = 618.4f;
 }
Esempio n. 13
0
 public void SetUp()
 {
     BattleCanvas.Instance.OnActive(unit);
     skill = SkillDataBase.GetSkill(SkillType.Fire);
 }
Esempio n. 14
0
 public override void Init(ActorBevBase actor, SkillLogicDataBase logicData, SkillDataBase configData)
 {
     base.Init(actor, logicData, configData);
     this.m_ActiveSkillLogicData = (ActiveSkillLogicData)logicData;
     this.m_ActiveSkillData      = (ActiveSkillData)configData;
 }
Esempio n. 15
0
 private void ParseSkillDataBase(DataRow row, SkillDataBase data)
 {
     data.ID = int.Parse(row["ID"].ToString());
     data.Name = row["Name"].ToString();
     data.Description = row["Description"].ToString();
     data.Icon = row["Icon"].ToString();
     data.EffectTarget = row.IsNull("EffectTarget") ? (ActorType?)null : (ActorType)Enum.Parse(typeof(ActorType), row["EffectTarget"].ToString());
     data.ChangeAttribute = row.IsNull("ChangeAttribute") ? (AttributeType?)null : (AttributeType)Enum.Parse(typeof(AttributeType), row["ChangeAttribute"].ToString());
     data.ChangeRateOrVale = row.IsNull("ChangeRateOrVale") ? (RateOrValueType?)null : (RateOrValueType)Enum.Parse(typeof(RateOrValueType), row["ChangeRateOrVale"].ToString());
     data.ChangeValue = row.IsNull("ChangeValue") ? (float?)null : float.Parse(row["ChangeValue"].ToString());
     data.ShieldType = row.IsNull("ShieldType") ? (ShieldType?)null : (ShieldType)Enum.Parse(typeof(ActorType), row["ShieldType"].ToString());
 }
Esempio n. 16
0
 public override void Init(ActorBevBase actor, SkillLogicDataBase logicData, SkillDataBase configData)
 {
     base.Init(actor, logicData, configData);
     this.m_ActiveSkillLogicData = (ActiveSkillLogicData)logicData;
     this.m_ActiveSkillData = (ActiveSkillData)configData;
 }
Esempio n. 17
0
 public virtual void Init(ActorBevBase actor, SkillDataBase data)
 {
     this.Actor = actor;
 }
Esempio n. 18
0
 public virtual void Init(ActorBevBase actor, SkillLogicDataBase logicData, SkillDataBase configData)
 {
     this.Actor = actor;
 }
Esempio n. 19
0
 public virtual void Init(ActorBevBase actor, SkillDataBase data)
 {
     this.Actor = actor;
 }
Esempio n. 20
0
 public virtual void Init(ActorBevBase actor, SkillLogicDataBase logicData, SkillDataBase configData)
 {
     this.Actor = actor;
 }