Search Unity

Behavior Designer - Behavior Trees for Everyone

Discussion in 'Assets and Asset Store' started by opsive, Feb 10, 2014.

  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    If it's the error that I think that it is, it relates to removing some deprecated serialization code. Send me a PM with your invoice number and I'll send you an intermediate version which will load the old data and then you can update to the latest.
     
  2. gravyleaves

    gravyleaves

    Joined:
    Mar 19, 2014
    Posts:
    28
    I figured out my previous issue, it's just a unity inspector thing.

    All your playmaker calls seem to have significant overhead. Like it's kinda slow. 2 FSM calls in a sequence under an "until failure" decorator repeated 60 times takes almost 5 seconds.

    Sending as events, or StartFSM (both waiting for FSM to finish or not) doesn't make a difference.
    Not syncing variables and only doing the first FSM call was still slow as well.

    Is it a problem with 'until failure' slowness or just with using playmaker FSM actions?
    My old way using just playmaker was essentially instant.
     
  3. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    Here is the screen shot. I have PM you with the invoice#.
     

    Attached Files:

  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @gravyleaves -

    Have you tried profiling it? I just ran a very basic tree that repeats a PlayMaker FSM 60 times and it took 1.64 seconds. It could have been quicker than this but once Behavior Designer spots that it has already ran a task during that frame it stops, so it is limited by the frame rate. For reference, here's my tree:
    PlayMakerTest1Screenshot.png

    And the FSM:

    fsm.png

    The FSM task is waiting for the FSM to complete. Here's what the log looks like when the task is being started (notice the time at the start):
    And when the task has ended:
    The next time the task starts again is 0.3533 seconds into and that is when the next frame occurs.
    Of course, starting a PlayMaker FSM is going to have more overhead than just a native task because PlayMaker has to initialize. Behavior Designer caches everything that it can in order to make the transition as quick as it can be but it will always be slower than a native task, and there's no way to get around that.

    @kotor -

    Those weren't the errors that I thought that you were talking about. Sending an old version isn't going to help. When you updated to the most recent version, did you completely delete the Behavior Designer directory? It doesn't look like it can find the Behavior Designer Runtime dll.
     
  5. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I have deleted both Behavior designer and Behavior designer movement before updated. I have updated several times before, never had any problems. It just does not find the DLL. Anymore advice ?
     
  6. gravyleaves

    gravyleaves

    Joined:
    Mar 19, 2014
    Posts:
    28
    Ouch, Behavior Designer is framerate limited? Is there any chance of that changing?
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @kotor -
    First try importing into a fresh project to see if you get any errors. When you don't try bringing the Behavior Designer folder over to your existing project and see what happens

    @gravyleaves -
    There exists a check to make sure the tree doesn't cause an infinite loop. It is limited by framerate in that you can only run the entire tree once in a single frame. Furthermore, this only happens in the editor. If you want to remove this check you can by searching for the following within BehaviorManager.cs:
    Code (csharp):
    1.  
    2. // While in the editor make sure we aren't in an infinite loop
    3. if (++count > behaviorTree.taskList.Count) {
    4.  
    And remove that block of code. You'll know that you hit this check because it will output to the log (even if logging isn't enabled). You'll also have to remove the following:

    Code (csharp):
    1.  
    2.   // bail out if the child index is the same as what it was before runTask was executed
    3.   if ((childIndex == prevChildIndex && status != TaskStatus.Running) || !IsBehaviorEnabled(behaviorTree.behavior)) {
    4.   status = TaskStatus.Running;
    5.   break;
    6.   }
    7.  
    Edit: To add onto this, if your FSM takes more than one frame to execute then you don't need to remove this check.
     
    Last edited: Oct 8, 2014
  8. gravyleaves

    gravyleaves

    Joined:
    Mar 19, 2014
    Posts:
    28
    I've got a few feature requests:

    The color yellow

    Manually sync vars playmaker action.

    Ability to edit sync'd variables instead of deleting and redoing them in the inspector

    And I know this isn't small but I think it would be better to do infinite loop checks like playmaker so you don't artificially slow things down in the editor's runtime. They throw an exception after 1000 loops of any FSM, but that can be overridden to any integer value.

    Thanks so much!
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    We tried yellow tasks but it was too bright of a color so you couldn't read the text. In general only the darker task colors work.

    I've written your other feature requests down, I really like the idea of being able to specify a maximum number of tasks to run instead of just limiting it to one complete tree execution a frame. This is more of a rare situation though because chances are very high that you are going to have at least one task return a status of running throughout the entire tree.
     
  10. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    That solved the problem. Thanks
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Behavior Designer 1.4.2.1 has been released on the Asset Store and is available to those who purchased via opsive.com. This version is completely a bugfix release and contains some performance improvements related to the Behavior Manager runtime. You can see the full release notes here.
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Behavior Designer - Movement Pack 1.3.1 has been released on the Asset Store and is available to those who purchased via opsive.com. You can see the full release notes here. Just like the Behavior Designer release from yesterday, this is completely a bugfix release.
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Does it make any sense to have Behavior Designer link up with TargetPro / TriggerEventPro? Path-o-logical has issued a new version.
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I didn't realize that TriggerEventPRO was released. I was in the beta for it but was going to wait to make tasks until it was out. Yes, it does make sense. I have had it on my list and will be creating tasks for it
     
    hopeful likes this.
  15. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    how to find all the task and save all variable to json or xml,then load the json or xml dato to init the behavior tree in runtime?
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There is no built in way to do that but it shouldn't be too hard to add it. You can get the root task with:

    Code (csharp):
    1.  
    2. GetComponent<Behavior>().GetBehaviorSource().RootTask
    3.  
    And then traverse the children by checking to see if the task is a ParentTask and then getting the children:

    Code (csharp):
    1.  
    2.   if (task is ParentTask) {
    3.     var parentTask = task as ParentTask;
    4.     if (parentTask.Children != null && parentTask.Children.Count > 0) {
    5.      for (int i = 0; i < parentTask.Children.Count; ++i) {
    6.       SaveTaskVariables(parentTask.Children[i]);
    7.      }
    8.     }
    9.   }
    10.  
    This is assuming the function SaveTaskVariables exists. From there you can use reflection to get all of the fields and save out their values to json or xml. To load the values back in you basically just do the same thing in reverse.

    I should note that Behavior Designer does have an option of serializing with JSON if you disable "Use Binary Serialization" in the preferences. This data is saved at Behavior.GetBehaviorSource().TaskData.JSONSerialization. I haven't exposed too much in terms of actually using this data though but I'm open to hearing the use cases.
     
  17. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    thanks ~it work ^_^
     
    Last edited: Oct 16, 2014
  18. gravyleaves

    gravyleaves

    Joined:
    Mar 19, 2014
    Posts:
    28
    I have a really weird bug. Because global variables can't be sync'd yet I sync the same playmaker variable to two different behavior trees of different groups. This same object with the sync variables script component contains both trees.

    The behavior tree's variables that are first in the sync vars script list always syncs fine. The second one's variables only sync when the game object containing the sync vars script is visible in the inspector!!!???

    If I press play with an object with out the script selected and visible in the inspector it doesn't sync. If during play I then select that object with the script it does sync.


    EDIT: I guess you can disregard most of the above, as I always had the tree 'locked'. So whenever I hit play without the certain behavior tree visible and selected in the editor I get the error
    So whenever I call that tree to start from playmaker it just freezes.

    EDIT 2: I figured I should add the first and second errors
    Error 1:
    Error 2 (through infinity, until my playmaker FSM tries to call the tree that's been disabled):

    EDIT 3: Also unless the playmaker FSM which I am syncing with is selected and visible when I press run the variables won't sync. But I don't get any errors in this case, as the tree runs without being disabled automatically.
     
    Last edited: Oct 19, 2014
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Sorry for taking awhile to respond, I'm just getting back from traveling and finally have an Internet connection again.

    I'm reading through your edits trying to figure out how to reproduce it. First off, the BinaryDeserialization.LoadTask ArgumentOutOfRange exception is a known bug and has been fixed for the next version. Send me a PM with your invoice number and I can send you a new version.

    I don't think the ArgumentOutOfRange exception is related. So what is your setup? You have two different VariableSynchronizer components on two different GameObjects which sync the same PlayMaker variable? Which direction are you trying to sync the variable? If you are going from Behavior Designer to PlayMaker, it will only appear as if one variable is being synchronized because only the last behavior trees changes will actually take effect. The first behavior tree will update it, but then immediately following that the second tree will overwrite what changes the first tree made. Is this the setup that you have?

    Also, how did you get that NullReferenceException? Just disabled the behavior tree after it has been started?
     
  20. gravyleaves

    gravyleaves

    Joined:
    Mar 19, 2014
    Posts:
    28
    The NullReferenceException I think is because the behavior tree disables itself when it wrongly claims there's no root task.

    Sometimes the tree runs when visible in the inspector (giving no such error) but then the variables don't sync

    My setup is as follows:

    My sync variables script is on the same game object with two behavior trees and two FSMs that are passing the same variable, a game object reference (which changes each time FSM A is called).

    Tree 1 <-- FSM A
    Tree 1 --> FSM B

    Tree 2 is then called after Tree 1 is done (never run at the same time)
    FSM A again gives the variable to the tree and then the tree passes it to FSM B

    Tree 2 <-- FSM A
    Tree 2 --> FSM B

    I can't just use a global playmaker variable because I also call different FSMs on the gameobject the variable is tracking from the trees
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for the more detailed information. I sent you a PM with the new version.

    I tried to reproduce the variable issue but I still wasn't able to. What is the Update Interval set to on your Variable Synchronizer? Here's what I think is happening:

    Behavior tree 1 and 2 tick
    FSM A and B tick
    Variables are synchronized

    If this order of events occur, you won't get the changes made in the behavior trees. The reason for this is because the variable synchronize to and from the behavior trees at the same time. The behavior trees never have a chance to update the value because the FSM basically overwrites that value. I am guessing that when you have a tree selected Unity changes the order that the scripts are executed so that's why you are seeing different results.

    If you have a repro scene that I can take a look at I'd love to verify what is happening.
     
  22. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Quick question:

    Am is BD supposed to be blurry, even in 4.6 Beta? If not would I merely reinstall? (I avoid doing that for fear of breaking so I'd rather ask first :D )

    Thanks!

    -Steven

    Screen Shot 2014-10-21 at 3.20.31 PM.png
     
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    It definitely is not supposed to be that blurry - it looks like you are also missing some images within the task inspector. I was just running it in the 4.6 beta about an hour ago and everything looked fine.

    Try to completely remove the /Behavior Designer folder and import again from the Asset Store.
     
  24. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ...still blurry :(

    I have no real additional info. Editor was fine in 4.5.5f1 and now it's blurry in 4.6 Beta...same Project with no changes to my toolset (i.e. additional assets).

    -Steven
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    What happens if you import it into a brand new project with no other assets? Also, which beta version are you using? I have tried it on the latest, beta 20.
     
  26. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Funny you asked that...

    ...tried it in a fresh project in 4.6 (yes beta 20) and it's less blurry, but still low-res?

    From the Magnifying glass icons to expose variables to the primary icons and gizmo's, it's not very crisp, hmmm...

    Screen Shot 2014-10-21 at 4.02.31 PM.png
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    hmm.. now you have all of the images at least. It's like the import settings on the images is set to being compressed, but I don't see how you can adjust that if the images are within a dll. Are you on Mac or Windows? I have only tried it on Windows - I'm downloading the latest Mac beta right now. I also noticed that there is a beta 21 so it might be worth giving that a shot.
     
  28. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea latest Macbook Pro 15, 16 gigs ram, 750m GPU, and still using OSX 10.9.5 (waiting to upgrade to Yosemite)...

    ...and again this is all fine in Unity 4.5 so...

    Gah! :D

    -Steven
     
  29. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh quick BG related question while you're around...

    ...what is the equivalent of 'while' in BD? For example I simply want:

    While 'Can See Target' is True ----> Pursue Target, else ---> Wander around.

    Every time I run in front of the character I'd like him to chase, but when I'm out of range/sight to back off and go back to wandering around.

    Basic I know but for some reason I'm unable to find info on this though I have to believe it exists.

    Thanks Opsive! :D

    -Steven
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I haven't ran it all on a Mac with 4.6 so I'll let you know as soon as I try it out. Unfortunately if I get similar results I don't think that I can do much about it so I'll log a bug with Unity.

    For your other question, in that case you should use the Self or Both conditional abort (video). With a type of Self or Both the Can See Target conditional task will be reevaluated every frame.
     
  31. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Thanks Opsive and yea as for Conditional Aborts (funny as I just read about them), this doesn't seem to work. I duplicated the last image on that page which contained the Can See/Can Hear conditionals, and I made sure to set the abort (I tried all three types). On scene Play, the conditionals just have Red X's over them, and nothing in the tree turns green; when I run in front of the enemy nothing happens. Can See is not reevaluating even though I'm standing right in front of the enemy (he has an FOV of 110' and a range of 25).

    EDIT: If I turn the enemy to face my character from the onset, he begins to Pursue but never stops pursuing, thus Can See is not reevaluating in this case either...
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Can you post a screenshot of your tree (blurriness and all)? You can tell a task is being reevaluated when it has a circle around the execution status (the checkmark or the X). For an example of a tree that is similar to what you are trying to accomplish, take a look at this post.

    Edit: I just remembered that the video linked to earlier also shows an example of an agent moving towards a target when the target is within sight.
     
  33. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    That link helped...I really thought I set it up like that but alas...apparently I did not!

    Btw, the Wander task doesn't seem to work very well. I've been able to use Apex's Wander script indefinitely, wandering all over the grid, but with the Wander task in BD, which I'm assuming is (or should be) identical to that script, he doesn't path properly at all and eventually squeezes himself off the map (collision error trying to walk through objects, again due to nonexistent pathing)

    Any thoughts? The task already seems to be missing features such as:

    • Radius (this is Wander Distance in your task)
    • Minimum Distance (missing...)
    • Linger For Seconds (missing...)
    • Bail After Failed Attempts (missing...)

    ...yet yours includes

    • Wander Rate (no clue what this does)
    Is there an easy way to call Apex's Wander script rather than use the Wander task?

    Thanks again for all your time tonight Opsive!

    -Steven
     
  34. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh I believe I misunderstood this as well:

    Your Wander code is YOUR 'Wander' code, and you're simply using Apex's pathing to derive the nextNode, yes? I honestly thought your Task was supposed to mirror Apex's script.

    That said, your Wander code doesn't play nice with Apex still... :(
     
  35. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Okay my last post for tonight!

    To answer my last query, I found a nice and tidy way to use Apex's Wander script in my Behavior Tree:

    Screen Shot 2014-10-21 at 6.37.25 PM.png

    ...as you can see Set Is Enabled enables the Wander Behaviour (Script) you see in the Inspector on the right, and of course the other one branched in the Sequence on the left disables it and voila, I easily can use scripts in my BG. I'm certain this is old news but I felt good about discovering this and thought it only fair I share, haha.

    Just to note, I did make one small adjustment to the Wander Behaviour script, adding one line to OnDisable() as such:

    Code (CSharp):
    1. private void OnDisable()
    2.         {
    3.             MoveNext(false); // Added THIS Line...
    4.             GameServices.messageBus.Unsubscribe(this);
    5.         }
    ...which stopped the pathing to the next node. If not the NPC would continue to path until all the waypoints were followed.

    Cheers!

    -Steven
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for the OnDisable suggestion, I'll add it. Yes, the wander script doesn't use the Apex Path wander component, though I have made a note to start using it in the next Movement Pack update. The wander task is relatively basic compared to the Wander component within Apex Path.

    (I'm still downloading the 4.6 on the Mac, the download is going pretty slowly. I imagine that I'll have an answer on what it looks like on my end tomorrow morning)
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @SteveB -

    I just imported Behavior Designer into a fresh project with beta 21 on the Mac and there isn't any blurriness. Maybe that was a bug in beta 20?
     
  38. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Turns out it's happening on even the original Unity icons/gizmos, having just noticed it now when looking at my prefabs...

    ...thanks for your help regardless!
     
  39. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Screen Shot 2014-10-23 at 9.52.56 AM.png Gah! This wasn't happening before and now...

    I've never had to deal with this error and while I see it's happened to others, I'm not sure how to fix it.

    Thanks!

    -Steven
     
  40. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Reimport of those assets and restart of Unity seems to fix it...false alarm? :D
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    That's the first time that I've seen that error - if it happens to somebody else I know what I'll suggest first :)
     
  42. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Hi opsive,I meet a error when run at android ,but work fine at pc:

    SchemeBehaviorManager sbm=behaviorObj.AddComponent<SchemeBehaviorManager>();
    string mapName=_name;
    ExternalBehaviorTree runtimeBt=Resources.Load("sharedBehaviorTree/"+mapName) as ExternalBehaviorTree;
    Debug.LogError("======:" + runtimeBt);
    if (runtimeBt!=null)
    {
    SchemeBehaviorManager.instance.currentBehaviorTree = behaviorObj.gameObject.AddComponent<BehaviorTree>();
    Debug.LogError("==ccc====:" + SchemeBehaviorManager.instance.currentBehaviorTree);
    SchemeBehaviorManager.instance.currentBehaviorTree.ExternalBehavior = runtimeBt;
    SchemeBehaviorManager.instance.currentBehaviorTree.EnableBehavior();
    SchemeBehaviorManager.instance.ReflectDataForBehavior(behaviorTree);
    //SchemeBehaviorManager.instance.currentBehaviorTree.RestartWhenComplete = true;
    Debug.Log("ffffff");
    }
     

    Attached Files:

    • 333.png
      333.png
      File size:
      28.9 KB
      Views:
      1,087
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    What is SchemeBehaviorManager? Behavior Designer doesn't include a script with that name. It also doesn't have an object with the name "EnableScheme" which relates to the error that you are getting.
     
  44. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    hi opsive,SchemeBehaviorManager is a manager for reflect the behavior tree node in runtime which load the data from json had saved,and the EnableScheme is a new Action for invoke the Scheme launch .
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Can you post the code that is failing? Since this code isn't within Behavior Designer I'm not sure I'll be able to definitely say why it is failing on Android but I can give it a shot.
     
  46. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Hi Opsive.

    Can you (if possible) add an interface for Trigger Event PRO ?



    This is exactly the type of tool that blends well with BT. ;)
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Definitely, it will be in the next Behavior Designer release. UniStorm tasks will also be in this release
     
  48. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Wooow. Thanks for the fast and positive response. You're amazing. :eek:
     
  49. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. //
    4. using UnityEngine;
    5. using System.Collections;
    6.  
    7. namespace BehaviorDesigner.Runtime.Tasks
    8. {
    9.     public class mAction : Action {
    10.  
    11.         protected int treeNodeIndex;
    12.         protected bool TRIGGER_NET = false;
    13.         public virtual void TriggerSuccessByNetWork()
    14.         {
    15.             TRIGGER_NET = true;
    16.         }
    17.         public void SetTreeNodeIndex(int treeNode)
    18.         {
    19.             treeNodeIndex = treeNode;
    20.         }
    21.  
    22.     }
    23. }
    24.  
    25.  
    26. //
    27. namespace BehaviorDesigner.Runtime.Tasks
    28. {
    29.  
    30.     [TaskDescription("Enable scheme function and pic")]
    31.     public class EnableScheme : mAction {
    32.         public List<SchemeBase> schemeList=new List<SchemeBase>();
    33.         public override TaskStatus OnUpdate ()
    34.         {
    35.    
    36.             if (schemeList.Count == 0)
    37.             {
    38.                 return TaskStatus.Failure;
    39.             } else
    40.             {
    41.                 foreach(SchemeBase sb in schemeList)
    42.                 {
    43.                     sb.gameObject.SetActive(true);
    44.                 }
    45.             }
    46.    
    47.             return TaskStatus.Success;
    48.         }
    49.  
    50.     }
    51. }
    52. ////schemebehavior reflect this data function
    53.  
    54.                     if(field.GetValue(original)is List<SchemeBase>)
    55.                     {
    56.  
    57.                         JsonData sch=val["Sch"];
    58.                         List<SchemeBase> sbs=new List<SchemeBase>();
    59.                         for(int i=0;i<sch.Count;i++)
    60.                         {
    61.                             int schemeId=int.Parse(sch[i].ToJson());
    62.                             Debug.Log("---:"+schemeId);
    63.                             sbs.Add(LevelManager.instance.levelSchemeDic[schemeId]);
    64.                         }
    65.                         field.SetValue(original,sbs);
    66.  
    67.  
    Hi,opsive,thanks your reply~~.Above is the key code,and work at pc,I did not know where is wrong,and i changed the runtime folder below the resources folder,still not work.
     

    Attached Files:

    • ee1.png
      ee1.png
      File size:
      49.8 KB
      Views:
      1,043
    • pp.png
      pp.png
      File size:
      24.9 KB
      Views:
      1,021
    • ee.png
      ee.png
      File size:
      47.7 KB
      Views:
      992
    Last edited: Oct 27, 2014
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Just based on your code I can't see anything that would fail on Android. What is mAction that you are deriving EnableScheme from? Is script debugging enabled in your build? Also, Unity doesn't like it when your script name doesn't match your task name (script name EnableSchemeFunc and task name EnableScheme).