public void SetPanel(UnitGraphics go, string header, string body) { textBody.text = body; textHeader.text = header; BuildCamera(); BuildPreview(go); }
public Transform CreateUnit(UnitEntity unitEnt, TilePosition posinfo) { var pos = posinfo.Point; Quaternion ur = UnitTemplate.rotation; Quaternion rot = new Quaternion(ur.x + 0.14f, ur.y, ur.z, ur.w); Vector3 unitvec = ConvertUnitPos(pos); var unitobj = (Transform)Instantiate(UnitTemplate, unitvec, rot); var info = unitobj.gameObject.AddComponent <UnitInformation>(); unitobj.gameObject.AddComponent <UnitViewHandler>(); unitobj.gameObject.AddComponent <UnitControllerHandler>(); info.SetEntity(unitEnt); UnitGraphics graphic = (UnitGraphics)GraphicFactory.ConstuctGraphic(unitEnt.getUnitType()); graphic.SetUnitObj(unitobj.gameObject); graphic.Initialize(this); info.SetGraphics(graphic); var viewhandler = unitobj.gameObject.GetComponent <UnitViewHandler>(); viewhandler.Factory = this; viewhandler.HealthBar = (Transform)Instantiate(this.HealthBarTemplate); viewhandler.HealthBar.GetComponent <HealthbarView>().SetPosition(pos); this.gameobjLookUp.Add(unitEnt, unitobj.gameObject); return(unitobj); }
public GizmoidView BuildGizmoid(GizmoidData data, UnitGraphics preview = null) { if (gizmoids.Count == 6) { return(null); } var giz = Instantiate(prefabGizmoid, transform); giz.transform.localPosition = new Vector3(0, blade.radiusOffset + (GetSpacing() * gizmoids.Count), 0); giz.transform.eulerAngles = new Vector3(0, 0, blade.gameObject.transform.eulerAngles.z); //giz.holder = this; if (!preview) { preview = Instantiate(data.unitGraphics); } giz.SetData(data, gizmoids.Count, preview); gizmoids.Add(giz); onGizmoidAdded.Invoke(giz); giz.onDestroy.AddListener(RemoveGizmoid); var rand = Random.Range(0, giz.assets.clipArrivals.Count); AudioPlayer.Instance.PlaySoundClip(giz.assets.clipArrivals[rand], giz.transform); return(giz); }
public void SetData(GizmoidData data, int order, UnitGraphics preview = null) { name = data.nameInternal; assets = data.assetData; if (preview) { SetupGraphics(preview, false, order); } else { SetupGraphics(data.unitGraphics, true, order); } SetupReskin(data.nameInternal, data.maxHealth, unitGraphics.renderers); SetupHealth(data.maxHealth); SetupAbilities(data.abilities); foreach (var item in abilities) { var arenaCollider = item.GetComponent <ArenaCollider>(); if (arenaCollider) { arenaCollider.BuildColliders(order); onOrderChanged.AddListener(arenaCollider.BuildColliders); } } CollectOverclockables(); }
public void BuildHourGlass(Transform parent, UnitGraphics am) { if (!hourglass) { return; } var timer = Instantiate(hourglass, parent); timer.gameObject.transform.position = Vector3.zero; timer.gameObject.transform.localPosition = Vector3.zero; timer.gameObject.transform.eulerAngles = Vector3.zero; foreach (var time in timer.GetComponentsInChildren <SpriteRenderer>()) { time.sortingLayerName = am.animSortingLayer; int order = 0; foreach (var rend in am.renderers) { if (rend.sortingOrder > order) { order = rend.sortingOrder; } } time.sortingOrder = order + 1; } timer.StartHourglass(am, 8, Color.cyan); }
public void SetPanel(UnitGraphics go, string header, string body, System.Action callback) { //gameObject.SetActive(true); //transform.SetAsLastSibling(); SetButtonEvents(callback); SetPanel(go, header, body); }
public void StartHourglass(UnitGraphics am, float dur, Color col) { animationManager = am; color = col; duration = dur; StartCoroutine(HandleHourglass(duration, color)); }
public void ReceiveXp(int xp) { this.xp += xp; graphics = gameObject.GetComponent <UnitGraphics>(); if (graphics != null) { graphics.showXp(xp); } }
public void receiveXp(int xp) { xp_ += xp; graphics_ = gameObject.GetComponent <UnitGraphics>(); if (graphics_ != null) { graphics_.showXp(xp); } }
public Struct27(double A_0, UnitGraphics A_1) { int num = 0x11; if (!Enum.IsDefined(typeof(UnitGraphics), A_1)) { throw new InvalidEnumArgumentException(BookmarkStart.b("䌶䀸䬺堼", num)); } this.double_10 = A_0; this.unitGraphics_0 = A_1; }
public void ChangePreview(UnitGraphics animationManager) { //RemoveGraphics(); if (preview) { Destroy(preview.gameObject); } preview = Instantiate(animationManager, transform); preview.transform.localScale = Vector3.one; preview.transform.localPosition = Vector3.zero; preview.SetSortingLayer("Preview"); }
void Awake() { damageReceived = 0; movingState = new MovingState(this); rotatingState = new RotatingState(this); castingState = new CastingState(this); stunnedState = new StunnedState(this); deadState = new DeadState(this); movingState.AddPauser(castingState); movingState.AddPauser(stunnedState); movingState.AddBlocker(deadState); rotatingState.AddPauser(stunnedState); rotatingState.AddBlocker(deadState); castingState.AddBlocker(stunnedState); castingState.AddBlocker(deadState); stunnedState.AddBlocker(deadState); actionStates = new List <ActionState>(); actionStates.Add(movingState); actionStates.Add(rotatingState); actionStates.Add(castingState); actionStates.Add(stunnedState); actionStates.Add(deadState); if (skills == null) { skills = new List <Skill>(); } if (perks == null) { perks = new List <Perk>(); } graphics = gameObject.AddComponent <UnitGraphics>(); if (activeController == null) { activeController = gameObject.GetComponent <UnitController>(); } if (unitData == null) { unitData = new UnitData(); } }
public void SetupGraphics(UnitGraphics animPrefab) { unitGraphics = Instantiate(animPrefab, Vector3.zero, Quaternion.identity, transform); unitGraphics.SetSortingLayer("Enemies"); unitGraphics.transform.localRotation = Quaternion.identity; unitGraphics.transform.localPosition = Vector3.zero; if (unitGraphics is DebrisGraphics) { var debris = unitGraphics as DebrisGraphics; debris.SetDebrisType(enemyData.nameInternal); onImpact.AddListener(debris.BuildParticle); mover.onDetour.AddListener(debris.OnDetour); } }
public void SetupGraphics(UnitGraphics animMan, bool instant, int order) { if (instant) { unitGraphics = Instantiate(animMan); } else { unitGraphics = animMan; } unitGraphics.transform.SetParent(transform); unitGraphics.transform.localPosition = Vector3.zero; unitGraphics.transform.localRotation = Quaternion.identity; unitGraphics.SetSortingLayer("Gizmoid" + order); }
void Awake() { damageReceived = 0; rotationSpeed = 2; isMoving = false; isRotating = false; isCasting = false; isDead = false; isStunned = false; graphics = gameObject.AddComponent <UnitGraphics>(); if (unitDataEditor != null) { unitData = new UnitData(unitDataEditor); } }
public void BuildPreview(UnitGraphics gameObject) { RemovePreview(); var ug = Instantiate(gameObject, Vector3.zero, Quaternion.identity); ug.anim.updateMode = AnimatorUpdateMode.UnscaledTime; preview = ug.gameObject; preview.layer = 8; var children = preview.GetComponentsInChildren <Transform>(true); foreach (var item in children) { item.gameObject.layer = 8; } }
private void ShowUnitView() { if (unitSelected == null) { return; } UnitGraphics unitGraphics = unitSelected.UnitGraphics; unitGraphics.unitMarker.Switch(false); GameObject graphics = unitGraphics.gameObject; unitViewer = Instantiate( graphics, graphics.transform.position, graphics.transform.rotation ).GetComponent <UnitViewer>(); unitViewer.Show(unitSelected); }
public void PlacePreview(GizmoidData data, UnitGraphics preview) { float duration = 0.5f; preview.transform.SetParent(transform); Vector3 rot = Vector3.zero; if (transform.localEulerAngles.z > 180f) { rot = new Vector3(0, 0, 359.9f); } preview.SetSortingLayer("Gizmoid" + gizmoids.Count); sequence = DOTween.Sequence(); sequence.Join(preview.transform.DOLocalMove(new Vector3(0, blade.radiusOffset + (GetSpacing() * gizmoids.Count), 0), duration).SetEase(DG.Tweening.Ease.OutBounce)) .Join(preview.transform.DOLocalRotate(rot, duration).SetEase(DG.Tweening.Ease.OutQuart)) .OnComplete(() => BuildGizmoid(data, preview)); }
// Use this for initialization void Start() { UnitInformation info = this.gameObject.GetComponent <UnitInformation>(); entity = info.Entity; graphics = info.Graphics; direction = new Vector(entity.PositionAs <TilePosition>().Point, new Point(0, 0)).Direction; //this.gameObject.renderer.material.color = info.ControllerInfo.FocusColor; entity.Register(new Trigger <ActionHandShakeInqueryEvent <MoveAction> >(evt => evt.Action.HandShakeRequired = true)); entity.Register(new Trigger <ActionStartingEvent <MoveAction> >(OnStartMoveAction)); entity.Register(new Trigger <BeginMoveEvent>(OnUnitBeginMove)); entity.Register(new Trigger <UnitTakesDamageEvent>(OnTakeDamage)); entity.Register(new Trigger <ActionStartingEvent <MovePathAction> >(OnUnitBeginPathMove)); entity.Register(new Trigger <ActionCompletedEvent <MovePathAction> >(OnUnitFinishPathMove)); entity.Register(new Trigger <UnitDieEvent>(OnUnitDeath)); this.HealthBar.GetComponent <HealthbarView>().SetHealthPct(this.entity.Module <HealthModule>().HealthPct); this.HealthBar.parent = this.transform; this.graphics.UseUnitAnimation(StandardUnitAnimations.Idle); }
public void OnDragEnd(PointerEventData eventData) { CheckSector(); if (selectedBlade && selectedBlade.gizmoidHolder.gizmoids.Count < 6 && gizmoidData != null) { selectedBlade.gizmoidHolder.PlacePreview(gizmoidData, preview); if (eventData.pointerDrag) { var unitSelect = eventData.pointerDrag.GetComponent <UnitSelectorButton>(); if (unitSelect) { unitSelect.Acquire(); } } preview = null; selectedBlade = null; } sectorSelector.gameObject.SetActive(false); transform.position = new Vector3(10, 0, 0); gameObject.SetActive(false); }
public void method_14(UnitGraphics A_0) { int num = 0x10; if (this.unitGraphics_0 != A_0) { switch (A_0) { case UnitGraphics.Point: this.double_10 = this.method_2(); this.unitGraphics_0 = UnitGraphics.Point; return; case UnitGraphics.Inch: this.double_10 = this.method_4(); this.unitGraphics_0 = UnitGraphics.Inch; return; case UnitGraphics.Millimeter: this.double_10 = this.method_6(); this.unitGraphics_0 = UnitGraphics.Millimeter; return; case UnitGraphics.Centimeter: this.double_10 = this.method_8(); this.unitGraphics_0 = UnitGraphics.Centimeter; return; case UnitGraphics.Presentation: this.double_10 = this.method_10(); this.unitGraphics_0 = UnitGraphics.Presentation; return; } throw new ArgumentException(BookmarkStart.b("挵嘷儹刻儽㜿ⱁ摃㍅♇⍉㡋湍⭑㍕扗穙筛", num) + A_0 + BookmarkStart.b("ᄵ", num)); } }
public void AddGraphicsListener(UnitGraphics unitGraphics) { onLaunch.AddListener(unitGraphics.OnActivePlay); onPrep.AddListener(unitGraphics.OnPrepPlay); onRecover.AddListener(unitGraphics.OnRecoverTrigger); }
public void method_3(double A_0) { this.double_10 = A_0; this.unitGraphics_0 = UnitGraphics.Point; }
public Struct27(double A_0) { this.double_10 = A_0; this.unitGraphics_0 = UnitGraphics.Point; }
public void method_9(double A_0) { this.double_10 = A_0; this.unitGraphics_0 = UnitGraphics.Centimeter; }
public void method_7(double A_0) { this.double_10 = A_0; this.unitGraphics_0 = UnitGraphics.Millimeter; }
public void method_5(double A_0) { this.double_10 = A_0; this.unitGraphics_0 = UnitGraphics.Inch; }
public void AddGraphicsListener(UnitGraphics unitGraphics) { this.unitGraphics = unitGraphics; //onTargetSighted.AddListener(unitGraphics.OnActivateBool); }
public void AddGraphicsListener(UnitGraphics unitGraphics) { onLaunch.AddListener(unitGraphics.OnActivePlay); }