コード例 #1
0
ファイル: MoveNode.cs プロジェクト: seak123/ProjectACS
 public void Construct()
 {
     _unit      = BattleProcedure.CurSession.Field.FindUnit(_casterUid);
     _time      = 0f;
     _stage     = 1;
     bCompleted = false;
 }
コード例 #2
0
ファイル: UnitTitle.cs プロジェクト: seak123/ProjectACS
    public void BindUnit(UnitAvatar unit)
    {
        _master = unit;

        _nameText.text = _master.Name;
        RefreshHp();
        RefreshEnergy();
        _selectFlag.SetActive(false);
        _actFlag.SetActive(false);
    }
コード例 #3
0
 public MoveAnimation(Unit unit, TileVector origin, TileVector destination, CardinalDirection direction, int energyCost)
 {
     _avatar    = unit.Avatar;
     _targetPos = destination.ToVector3();
     _targetRot = direction.GetBearingRotation();
     // TODO: implement energycost, advanced bar animation
     _targetEnergy = unit.Energy;
     _isStep       = origin != destination;
     moveSound     = _avatar.moveSound;
 }
コード例 #4
0
    //===================== unit function ================================

    public void CreateUnit(int uid, UnitVO unitVO, MapCoordinates createPos)
    {
        ResourceManager.Instance.LoadAssetAsync(unitVO.prefabPath, (asset) =>
        {
            GameObject obj    = Instantiate(asset) as GameObject;
            UnitAvatar avatar = obj.AddComponent <UnitAvatar>();
            avatar.UnitPos    = createPos;
            Unit unit         = new Unit();
            unit.vo           = unitVO;
            unit.avatar       = avatar;
            unit.pos          = createPos;
            unitMap.Add(uid, unit);
            obj.transform.SetParent(mapGrid.MapUnitRoot.transform);
            obj.transform.position = createPos.WorldPosition;
            SetMapCellState(createPos, MapCellState.Occupy);
            GetMapCellData(createPos).unit = unit;
        });
    }
コード例 #5
0
        public readonly UnitAvatar Avatar;              // Unity representation

        public Unit(UnitAvatar avatar, Player owner, TileVector position, CardinalDirection facing, bool mirrored)
        {
            // IMPLEMENTATION NOTE: Unit construction should not have any side effects. if you need to keep track
            //						of new units being created, you should call that from WorldController.AddUnit.
            Avatar = avatar;

            _moveMethod = Avatar.Ai.GetMovementPlan;
            Owner       = owner;

            Position = position;
            Facing   = facing;

            MaxHealth = Avatar.MaxHealth;
            Health    = MaxHealth;

            MaxEnergy = Avatar.MaxEnergy;
            Energy    = MaxEnergy;

            Mirrored = mirrored;
        }
コード例 #6
0
 protected SyncedAnimation(UnitAvatar owner, UnitAvatar target)
 {
     Owner  = owner;
     Target = target;
 }
コード例 #7
0
 public void Construct()
 {
     _unit      = BattleProcedure.CurSession.Field.FindUnit(_targetUid);
     bCompleted = false;
 }
コード例 #8
0
 public DeployAnimation(UnitAvatar unit)
 {
     _unit       = unit;
     deploySound = _unit.inSound;
 }
コード例 #9
0
 public DestroyAnimation(UnitAvatar target)
 {
     _target = target;
 }