void Start () { m_skillConfigs = GameObject.FindObjectOfType(typeof(SkillConfigs)) as SkillConfigs; if (m_skillConfigs == null) { Debug.LogError ("Error SkillConfigs Gameobject is not have"); } m_scriptUnit = GetComponent<Unit> (); if (directionArrow) { m_directionArrow = (Transform)Instantiate (directionArrow , m_transform.position, m_transform.rotation); m_directionArrow.parent = m_transform; m_directionArrow.localPosition = new Vector3 (0, 0.02f, 0.12f); } }
//< 把其他的复制添加到我这里 public void Copy( SkillConfigs other ) { for (int i = 0; i < other.m_configs.Count; i++) { Config o= other.m_configs[i]; //< 其他资源 Config m = CheckIsHave( o.m_skillID ); //< 监测 此技能ID 的资源是否存在我这里 if( m == null ) { m_configs.Add(new Config()); m_configs[m_configs.Count-1].Copy(o); }else { m.Copy(o); //< 存在覆盖 } } }