void DrawDisplayWindow() { kv = kanjiBase.values; GUILayout.BeginArea(dispRect); dispScrollPos = GUILayout.BeginScrollView(dispScrollPos, GUILayout.Width(dispRect.width), GUILayout.Height(dispRect.height - 25)); GUI.skin.textField.margin.right = 20; GUILayout.Label("Selected Kanji", EditorStyles.boldLabel); EditorGUILayout.SelectableLabel("UUID: " + kanjiBase.uuid); kanjiBase.entryName = EditorGUILayout.TextField("Name", kanjiBase.entryName); // kanjiBase.repColor = EditorGUILayout.ColorField("List color", kanjiBase.repColor); kanjiBase.icon = (Sprite)EditorGUILayout.ObjectField("Kanji Icon", kanjiBase.icon, typeof(Sprite), false); // kanjiBase.tintColor = EditorGUILayout.ColorField("Kanji Tint Color", kanjiBase.tintColor); GUILayout.Label("Kanji values", EditorStyles.boldLabel); valuePage = GUILayout.Toolbar(valuePage, pageStrings); EditorGUIUtility.labelWidth = 150; switch (valuePage) { case 0: DrawUsagePart(); break; case 1: DrawActivationPart(); break; case 2: DrawEffectPart(); break; } EditorGUIUtility.labelWidth = 100; GUILayout.EndScrollView(); GUILayout.EndArea(); }
public override bool Use(KanjiValues values, int attackValue, MouseInformation info) { var shotTransform = Instantiate(values.projectile) as Transform; Projectile projectile = shotTransform.GetComponent <Projectile>(); if (placeInMiddle) { Vector3 pos = new Vector3(info.position1.x + info.distX * 0.5f, info.position1.y + info.distY * 0.5f, 0); shotTransform.position = pos; } else { shotTransform.position = info.position2; } if (setRotation) { float rotation = info.rotationInternal * 180 / Mathf.PI; shotTransform.localRotation = Quaternion.AngleAxis(rotation, Vector3.forward); } projectile.lifeTime = values.projectileLifetime; projectile.multiHit = values.multihit; projectile.SetDamage(values.damage, attackValue, values.baseDamageScale); projectile.SetMovement(values.projectileSpeed, info.rotationInternal); MainControllerScript.instance.battleGUI.effectList.Add(projectile); return(true); }
public void CopyValues(KanjiValues other) { startCooldownTime = other.startCooldownTime; maxCharges = other.maxCharges; delay = other.delay; cooldown = other.cooldown; kanjiType = other.kanjiType; area = other.area; holdMin = other.holdMin; holdMax = other.holdMax; projectile = other.projectile; projectileSpeed = other.projectileSpeed; projectileLifetime = other.projectileLifetime; damage = other.damage; baseDamageScale = other.baseDamageScale; multihit = other.multihit; }
public override bool CanActivate(KanjiValues values, MouseInformation info) { if (info.holding || info.holdDuration > values.holdMax) { return(false); } if (!info.clicked) { return(false); } float dist = info.GetInternalDistance(); if (dist > values.area) { return(false); } return(true); }
public override bool CanActivate(KanjiValues values, MouseInformation info) { if (info.holding || info.holdDuration > 0.5f) { return(false); } if (!info.clicked) { return(false); } float dist = info.GetInternalDistance(); if (dist < values.area) { return(false); } float lCone = Mathf.PI * lowAngle / 180.0f; float hCone = Mathf.PI * highAngle / 180.0f; if (lCone < info.rotationInternal && info.rotationInternal < hCone) { return(true); } if (bothDirections) { lCone = lCone - (Mathf.PI * Mathf.Sign(lCone)); hCone = hCone - (Mathf.PI * Mathf.Sign(hCone)); if (lCone < info.rotationInternal || info.rotationInternal < hCone) { return(true); } } return(false); }
public override bool CanActivate(KanjiValues values, MouseInformation info) { if (info.holdDuration < values.holdMin || !info.holding) { return(false); } if (!continuous) { info.holdDuration = 0; } // float dist = info.GetInternalDistance(); // if (dist > area) { // if (running) { // running = false; // base.reduceCharge(1.0f); // info.holdDuration = 0; // } // return false; // } return(true); }
abstract public bool CanActivate(KanjiValues values, MouseInformation info);
/// <summary> /// Trigger the kanji effect. /// </summary> /// <param name="values"></param> /// <param name="info"></param> /// <returns></returns> abstract public bool Use(KanjiValues values, int attackValue, MouseInformation info);