public void SetOpponentTarget(int _ChunkIndex, string _ChunkString) { if (!m_OpponentTargetMap.ContainsKey(_ChunkIndex)) { m_OpponentTargetMap.Add(_ChunkIndex, null); } if (!m_OpponentOriginalPosition.ContainsKey(_ChunkIndex)) { m_OpponentOriginalPosition.Add(_ChunkIndex, Vector3.zero); } if (!m_SelfOriginalPosition.ContainsKey(_ChunkIndex)) { m_SelfOriginalPosition.Add(_ChunkIndex, Vector3.zero); } m_OpponentTargetMap[_ChunkIndex] = GlobalSingleton.Find(_ChunkString, true); m_OpponentOriginalPosition[_ChunkIndex] = m_OpponentTargetMap[_ChunkIndex].transform.position; m_SelfOriginalPosition[_ChunkIndex] = ChunkRef[_ChunkIndex].transform.position; if (null == m_OpponentTargetMap[_ChunkIndex]) { Debug.LogWarning("SetOpponentTarget null == null == m_OpponentTargetMap _ChunkString" + _ChunkString); } if (!m_ActuallyBeenHittedMap.ContainsKey(_ChunkIndex)) { m_ActuallyBeenHittedMap.Add(_ChunkIndex, false); } m_ActuallyBeenHittedMap[_ChunkIndex] = false; }
public void DoAnimation( Character _CharRef, string _ChunkNode, int _ChunkIndex, AnimationState _NextState, float _DelayTime = 0.0f) { RootRef = _CharRef.gameObject; ChunkRef[_ChunkIndex] = GlobalSingleton.Find(_ChunkNode, true); Mesh_VoxelChunk Mesh = _CharRef.mesh as Mesh_VoxelChunk; string BoneIndex = "bone" + _ChunkIndex; // ChunkRef if (null != ChunkRef && null != RootRef && Mesh.Chunks.ContainsKey(BoneIndex)) { ChunkMapRef[_ChunkIndex] = Mesh.Chunks[BoneIndex]; // GlobalSingleton.DEBUG("Ready to change parent:"+ ChunkMapRef[_ChunkIndex].Count); foreach (GameObject go in ChunkMapRef[_ChunkIndex]) { go.transform.SetParent(ChunkRef[_ChunkIndex].transform); } } ChangeAnimationState(_ChunkIndex, _NextState, _DelayTime, true); }