public static ObjectMechanismObject CreateObjectMechanismObject(ObjectMechanismDefinition definition, int x, int y)
        {
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0082: Unknown result type (might be due to invalid IL or missing references)
            //IL_0083: Unknown result type (might be due to invalid IL or missing references)
            if (null == s_instance)
            {
                Log.Error("CreateObjectMechanismObject called while the factory is not ready.", 284, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                return(null);
            }
            if (!FightMap.current.TryGetCellObject(x, y, out CellObject cellObject))
            {
                Log.Error(string.Format("{0} called with an invalid position {1}, {2}.", "CreateObjectMechanismObject", x, y), 293, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                return(null);
            }
            Transform transform = cellObject.get_transform();
            Vector3   position  = transform.get_position();

            position.y += 0.5f;
            ObjectMechanismObject component = s_objectMechanismCharacterPool.Instantiate(position, Quaternion.get_identity(), transform).GetComponent <ObjectMechanismObject>();

            component.InitializeDefinitionAndArea(definition, x, y);
            component.SetCellObject(cellObject);
            return(component);
        }
 public static void ReleaseObjectMechanismObject([NotNull] ObjectMechanismObject instance)
 {
     if (s_objectMechanismCharacterPool != null)
     {
         s_objectMechanismCharacterPool.Release(instance.get_gameObject());
     }
 }
Beispiel #3
0
        public static IEnumerator CreateObjectMechanismObject(FightStatus fightStatus, ObjectMechanismStatus objectMechanismStatus, PlayerStatus ownerStatus, int x, int y)
        {
            ObjectMechanismDefinition objectMechanismDefinition = (ObjectMechanismDefinition)objectMechanismStatus.definition;

            if (!(null == objectMechanismDefinition))
            {
                ObjectMechanismObject objectMechanismObject = FightObjectFactory.CreateObjectMechanismObject(objectMechanismDefinition, x, y);
                if (!(null == objectMechanismObject))
                {
                    objectMechanismStatus.view = objectMechanismObject;
                    objectMechanismObject.alliedWithLocalPlayer = (GameStatus.localPlayerTeamIndex == ownerStatus.teamIndex);
                    yield return(objectMechanismObject.LoadAnimationDefinitions(objectMechanismDefinition.defaultSkin.value));

                    objectMechanismObject.Initialize(fightStatus, ownerStatus, objectMechanismStatus);
                    yield return(objectMechanismObject.Spawn());
                }
            }
        }